jamesfredley commented on code in PR #15475:
URL: https://github.com/apache/grails-core/pull/15475#discussion_r2875004588
##########
grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/taglib/ValidationTagLib.groovy:
##########
@@ -471,7 +471,12 @@ class ValidationTagLib implements TagLibrary {
PropertyEditor editor = registry.findCustomEditor(value.getClass(),
propertyPath)
if (editor) {
editor.setValue(value)
- return !(value instanceof Number) ? editor.asText?.encodeAsHTML()
: editor.asText
+ String formattedValue = editor.asText
+ if (value instanceof Number && formattedValue != null) {
+ DecimalFormatSymbols formatSymbols = new
DecimalFormatSymbols(webRequest.getLocale())
+ formattedValue =
formattedValue.replace(formatSymbols.minusSign, '-' as char)
+ }
+ return !(value instanceof Number) ? formattedValue?.encodeAsHTML()
: formattedValue
Review Comment:
PR updated with a completely new approach.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]