Skip to content

Preserve thousands separators in decimal parsers#36

Merged
mihape merged 1 commit into
mainfrom
fix-decimal-thousands-and-negative-values
Jul 1, 2026
Merged

Preserve thousands separators in decimal parsers#36
mihape merged 1 commit into
mainfrom
fix-decimal-thousands-and-negative-values

Conversation

@mihape

@mihape mihape commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • preserve Hungarian dot-only thousands separators such as 225.000 and 1.234.567
  • keep dot decimals such as 12.5 working
  • clamp negative numeric form values to zero after switching away from type=number fields
  • apply the parser behavior consistently in invoice, fleet, and utilities modules

Tests

  • node --check src/modules/invoices/invoices.module.js
  • node --check src/modules/fleet/fleet.module.js
  • node --check src/modules/utilities/utilities.module.js
  • git diff --check
  • targeted parser smoke test for comma decimals, dot decimals, Hungarian/English thousands formats, and negative values

Closes #35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7966d2a4dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +767 to +768
if (lastDot > -1 && /^\d{1,3}(\.\d{3})+$/.test(text)) {
return text.replace(/\./g, "");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve three-decimal measurement inputs

In the utilities module this parser is also used for meter readings and unit rates, not just currency fields. When users rely on the existing dot-decimal support and enter a value with exactly three fractional digits, such as 123.456 for a reading or 36.386 for a rate, this new thousands regex converts it to 123456/36386, corrupting the settlement calculation. Please limit the dot-thousands heuristic to fields where a grouped integer is expected, or otherwise disambiguate it so three-decimal measurements are preserved.

Useful? React with 👍 / 👎.

@mihape mihape merged commit 4c99fe5 into main Jul 1, 2026
1 check passed
@mihape mihape deleted the fix-decimal-thousands-and-negative-values branch July 1, 2026 06:05
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.

[Bug] Preserve Hungarian thousands separators in decimal parsers

1 participant