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

Prices with a decimal comma should be accepted #1513

Closed
php-coder opened this issue Jan 31, 2021 · 3 comments
Closed

Prices with a decimal comma should be accepted #1513

php-coder opened this issue Jan 31, 2021 · 3 comments

Comments

@php-coder
Copy link
Owner

Reported by our user:

In my country we use decimal comma instead of decimal point for currency. So at first I tried “0,75" instead of “0.75” but that did not work:
unnamed
The warning could be confusing for other (international) users, not clear what exactly was invalid in my case. Maybe you can set or add a warning for explaining what separator character to use. Or make it possible to use both comma and point.

@php-coder
Copy link
Owner Author

We should accept both cases and also we should cover all places where user can specify price.

@php-coder
Copy link
Owner Author

Discover a bug: when I specify michel price with a comma on the series info page, the server fails with:

Caused by: java.lang.NumberFormatException: null
        at java.math.BigDecimal.<init>(BigDecimal.java:494) ~[na:1.8.0_151]
        at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[na:1.8.0_151]
        at java.math.BigDecimal.<init>(BigDecimal.java:806) ~[na:1.8.0_151]
        at ru.mystamps.web.support.spring.mvc.PatchRequest.bigDecimalValue(PatchRequest.java:62) ~[classes!/:0.4.6-SNAPSHOT]
        at ru.mystamps.web.feature.series.RestSeriesController.updateSeries(RestSeriesController.java:91) ~[classes!/:0.4.6-SNAPSHOT]
        at ru.mystamps.web.feature.series.RestSeriesController$$FastClassBySpringCGLIB$$852da25.invoke(<generated>) ~[classes!/:0.4.6-SNAPSHOT]
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.20.RELEASE.jar!/:5.1.20.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:752) ~[spring-aop-5.1.20.RELEASE.jar!/:5.1.20.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.20.RELEASE.jar!/:5.1.20.RELEASE]
        at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:119) ~[spring-context-5.1.20.RELEASE.jar!/:5.1.20.RELEASE]
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.20.RELEASE.jar!/:5.1.20.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) ~[spring-aop-5.1.20.RELEASE.jar!/:5.1.20.RELEASE]
        at ru.mystamps.web.feature.series.RestSeriesController$$EnhancerBySpringCGLIB$$621c0aa2.updateSeries(<generated>) ~[classes!/:0.4.6-SNAPSHOT]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant