Skip to content

Commit

Permalink
refactor(safeParseFloat): clarify a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed Apr 20, 2024
1 parent 87a2a2c commit dcfed17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export function safeParseFloat(value: unknown) {
? value
: Number(value?.toString().trim() || Number.NaN);
return Number.isFinite(parsed)
? parsed || 0 // Treat `-0` as `0`
? parsed || 0 // Maps `-0` to `+0`
: null;
}

0 comments on commit dcfed17

Please sign in to comment.