Skip to content

fix: round max price to integer cents in nodes create#258

Merged
andreaanez merged 1 commit intomainfrom
andreaanez/fix-max-price-float
Mar 25, 2026
Merged

fix: round max price to integer cents in nodes create#258
andreaanez merged 1 commit intomainfrom
andreaanez/fix-max-price-float

Conversation

@andreaanez
Copy link
Copy Markdown
Contributor

@andreaanez andreaanez commented Mar 25, 2026

Summary

  • Fixes a floating point precision bug in sf nodes create where dollar-to-cents conversion (e.g. 17.60 * 100) could produce a non-integer value (1760.0000000000002), causing the API to reject the request with a deserialization error
  • Adds Math.round() to match the handling already present in nodes set and nodes extend

Fixes floating point precision error when converting dollar price to
cents (e.g. 17.60 * 100 = 1760.0000000000002), which caused the API
to reject the request. Aligns with the rounding already used in
`nodes set` and `nodes extend`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com bot commented Mar 25, 2026

Review changes with  SemanticDiff

Changed Files
File Status
  src/lib/nodes/create.ts  0% smaller

@joshi4 joshi4 self-requested a review March 25, 2026 20:10
Copy link
Copy Markdown
Contributor

@joshi4 joshi4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! lgtm!

@andreaanez andreaanez merged commit 101ad1e into main Mar 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants