Skip to content

Fix bug when pasting currency amount (parsing commas and decimals)#531

Open
Dustin-ONeil wants to merge 1 commit into
spliit-app:mainfrom
Dustin-ONeil:codex/fix-pasted-currency-values
Open

Fix bug when pasting currency amount (parsing commas and decimals)#531
Dustin-ONeil wants to merge 1 commit into
spliit-app:mainfrom
Dustin-ONeil:codex/fix-pasted-currency-values

Conversation

@Dustin-ONeil

Copy link
Copy Markdown

Summary

Fixes pasted currency values being misread when they include thousands separators.

For example, -$1,659.84 was previously normalized as -1.65984 because the first separator was treated as the decimal separator. This change normalizes common US and European pasted number formats into the existing internal format: digits, optional leading -, and . as the decimal separator.

Changes

  • Added a small normalizeNumberInput helper
  • Replaced the old expense form currency sanitizer
  • Supports common pasted values like:
    • -$1,659.84
    • -€1.659,84
    • 1,234,567.89
    • 1.234.567,89
  • Keeps simple decimal entry working for both 1.23 and 1,23
  • Applies the same normalization to amount, original amount, conversion rate, and split-by-amount fields
  • Does not add settings, migrations, or UI changes

Testing

  • npm test
  • npm run check-types
  • npm run lint
  • Targeted Prettier check on touched files

Transparency Note

This is my second small request using Codex for implementation help. I’m trying it out to see whether it improves my workflow, and I want to be transparent so reviewers can flag anything that feels off or low-quality.

@Dustin-ONeil Dustin-ONeil left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Reviewed for common GPT-related issues and unnecessary bloat. Let me know whether this feels lightweight enough and covers the right use cases. I’m happy to add more robust edge cases or stronger string-handling scenarios as needed.

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.

1 participant