pxNumber control not handling big number in Chrome and Firefox
When a big number is used with a pxNumber control, it gets automatically reformatted in such a way that PRPC complains the value is not valid.
This happens after installing hot-fix 8381.
Example of number:
In Firefox, the value get reformated like this when you click out of the fied:
PRPC display a 1.234xxxxxe+79 is not a valid value
In Chrome, the value is well formatted. But if we click on the spin box, the value gets reformatted like below:
and we get the same error: 1.234xxxxxe+79 is not a valid value
1.234xxxxxe+79 is not a valid value
Steps to Reproduce
- Install Hot fix 8381
- Create a single value property of type decimal or double.
- Use this property in a section with pxNumber control.
- At runtime, enter a big value like:
In Firefox, you should see straight the value being reformatted and a "1.234xxxxxe+79 is not a valid value".
In Chrome, just click on the spinbox to get the same error.
The root cause of this problem is withing browser used by PRPC.
After installing Hfix-8381, the pxNumber control is using the HTML 5 type=number. Unfortunately, this type number is creating this formating issue.
This is a browser behaviour, when we have type as number, will get the spinner button on the field in chrome and firefox browsers. Upon given large/big number (like in this example approx. 50 digits), then spinner will change to exponential notation with e+ .
On the second part , number is getting replaced with zeros after 17th digits. The key is to use Decimal here. If we use decimal the precision loss doesn’t happen.
So there are 2 solutions to this issue:
1. Have decimal instead of double as property type in property rule definition.
2. Change the type as a 'text' instead of 'number' in the pxNumber control configuration.
0% found this useful