Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Support non-breaking spaces in numeric strings #845

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

florianMo
Copy link
Contributor

Fixed: Support non-breaking spaces in numeric strings

(OFBIZ-13168)

Explanation

In forms, numeric fields are represented by an input with type "text", which allows user to enter/paste all characters, including non-breaking spaces ('\u00A0', '\u202F', '\u2007'), like "29 000" (the space is \u202F). More specifically, a user can copy/paste a string from an external tool which uses non-breaking spaces as a thousands separator, and expect that a visually correct string will be correctly interpreted by OFBiz.

OFBiz uses java.text.NumberFormat::parse method, which does not support non-breaking spaces : characters after this kind of spaces are simply ignored, and "29 000" becomes "29".

This PR only illustrates the problem and a way of fixing it, I'm not sure that this would be a good solution (maybe handle submitted strings elsewhere ? maybe more upstream ?).

Thanks: Nereide team

Copy link

sonarcloud bot commented Nov 5, 2024

@JacquesLeRoux JacquesLeRoux merged commit 04020d7 into apache:trunk Nov 6, 2024
6 checks 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