Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

pxNumber control not handling big number in Chrome and Firefox

SA-5745

Summary



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:
12345678901234567890123456789012345678901234567890123456789012345678901234567890

In Firefox, the value get reformated like this when you click out of the fied:
12345678901234600000000000000000000000000000000000000000000000000000000000000000
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:
1.23456789012345678e+79
and we get the same error: 1.234xxxxxe+79 is not a valid value

Error Messages



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:
12345678901234567890123456789012345678901234567890123456789012345678901234567890
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.


Root Cause


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.

Resolution



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.
Or 
 2.  Change the type as a 'text' instead of 'number' in the pxNumber control configuration.

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us