Question
Double precision issue.
Hi All,
I am currently working Pega 8.3 using the smart claims framework.
I have an issue we are facing here on the team. I am trying to set a double value without precision if there is no decimal values.
My team wants the clipboard to display the value without a decimal like this
1000
and not like this 1000.0
When I hard code a value to a double it works perfectly fine. But, when I apply a property to the value I am setting I get a trailing 0 always. Is there anyway around this?
All property types behave this way string, int, double so if I try to cast what I am setting as those it is still behaving similarly.
It is necessary for us to use double as we need a property that can handle big int datatype in the back end. I can solve this issue with the decimal property type, but, that does not solve our requirement.
See screenshots below
What is the consequence of the clipboard showing the .0 ? The clipboard is merely a way of showing what data is held in memory. The .0 is indicative of a Decimal data type but the number under the covers is still 1000.
As this is a numeric field, either:
For the second point, consider the formatNumber Control (for UI presentation) or the pxFormatNumber Function to create a string representation of the number that omits the decimal places, if you are sure it is always .0