Hi All,
i have a dollar function inside the value feature of TextField, this works fine if the Value is less than 10 digits, if it is more than 10 , the Dollar functions returns $N/A
how can i overcome this
Thanks in advance
Discussion posts and replies are publicly visible
I don't personally recommend using the code "fn!dollar() & index( etc...", as this won't actually call the dollar function on the value you're trying to convert (it will just insert a dollar sign, which can be done more easily just typing "$").
To recap, the correct syntax for dollar() is:
dollar( (value), (number of decimals) [optional], (exclude commas) [optional])
This example code (14 9's, or 99 trillion) works fine - once you add more 9's, the number starts behaing weirdly no matter what you do.
dollar( "99999999999999", 2 )
I'd like to point out that if you just need a "$" character, it might be simpler to just use the literal "$" character instead of the dollar() function. So just
a!textField( value: "$" & "999999999999999999999999999" )
Also note that neither technique will give number formatting like dollar() does (when called on an appropriate-sized number anyway), i.e. comma-separating each triplet and formatting the decimal (or including ".00" if none).
index( ri!PF_Request, "RevenueAtRisk", null)
if the value exceeds (eg - 12345678912), the above approach gives infinity(∞)
Can you confirm the type of ri!PF_Request.RevenueAtRisk? I'm pretty sure you have it stored as an Integer in your CDT, which is the main issue here. If you store it as a decimal or text, it should work fine. It isn't an issue with the dollar() function at all, just about how Appian deals with large integers.
yes it is an interger, am pretty new to Appian , please tell me one thing, this CDT is used in Various places, so if I change the type of it, will it affect those.
The main way this may affect other things is through the database. If you have a database table that is referenced with this CDT, then you would also have to update the table to use a decimal instead of integer. Once your CDT is updated though, all other design objects in Appian will update to use the updated version.
And even though changes in the database are unfortunate, I think they are necessary in this case. Any integer > 2^31 -1 will always return infinity, so you can't really use it anywhere if it is defined as an integer.