Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
3 replies
Subscribers
7 subscribers
Views
2983 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Could anyone please give me solution regarding large decimal number values stori
radhaa
over 9 years ago
Could anyone please give me solution regarding large decimal number values storing and validations on it,
I'm trying to give more than 15 digits number with two decimal digits,but it rounds that number to the nearest value and resetting the decimals to 0's.
Example:99999999999999999.99
I used fixed(), text() function to get the solution for this problem, but these also gave same behaviour.
Example: 1. fixed(
ri!num,
2,
true()
)
2. text(ri!num,"##################.##")
Apart from this, in rule inputs and pv's number(decimal) values was stored in exponential form if number is more than 10 digits ex: 1e+15.
I'm using len() to get length of the value, it reruns improper value Ex:5 because Rule input and Process variable storing exponential value.
and If I tried with len(fixed()), it was returning value more than length of the number specified....
OriginalPostID-124740
OriginalPostID-124740
Discussion posts and replies are publicly visible
0
PhilB
A Score Level 1
over 9 years ago
=a!floatingPointField(
label: "test",
instructions: "test",
required: true(),
requiredMessage: "Value required.",
validations: if(
ri!decimal>9999999999999.99,
"The number provided is too large.",
""
),
value: ri!decimal,
saveInto: ri!decimal
)
Unfortunately it looks like any number higher than 9999999999999.99 is rounded by the floating point field...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashleyb
over 9 years ago
value: if(isnull(local!stringUnitsPledged), 0, fixed(local!stringUnitsPledged, 5, true)),
validations: if(isnull(local!stringUnitsPledged), null, if(regexmatch("^[0-9]\\d{0,9}(\\.\\d{1,5})?$", fixed(local!stringUnitsPledged, 5, true)), null, "Enter no more than 15 characters")),
saveInto: {local!stringUnitsPledged, ri!exceptionDetails_cdt.unitspledged}
This will accept 10 places before the decimal and 5 after. Anything after the fifth decimal place is rounded.
*Also note that the origional value was stored into a local! string variable, validations were done, then was stored back into the origional decimal field.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
giridharn
over 9 years ago
radhaa, I am running into the same issue with numbers greater than 15 digits.. Can you please share the solution if you found ?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel