Skip to content

Commit

Permalink
fix(hiccup-svg): update ff() to always return string
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Apr 8, 2023
1 parent accc588 commit ae1d844
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/hiccup-svg/src/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export let PRECISION = 3;
export const setPrecision = (n: number) => (PRECISION = n);

/** @internal */
export const ff = (x: number) => (x === (x | 0) ? x : x.toFixed(PRECISION));
export const ff = (x: number) =>
x === (x | 0) ? String(x) : x.toFixed(PRECISION);

/** @internal */
export const fpoint = (p: Vec2Like) => ff(p[0]) + "," + ff(p[1]);
Expand Down

0 comments on commit ae1d844

Please sign in to comment.