Hi All,
I have a requirement to display a negative value with a dollar symbol and text functions but whenever I tried doing it am getting unexpected result.
For eg:
dollar(10000-30000,0) = "($20,000)" [but expected is "$20,000" an extra "(,)" is getting added due to negative symbol.
text(10000-30000,"0") = "2000-0" [but expected is "20000" an extra "-" is getting added due to negative symbol.
Do I need to pass anything specific format in the above functions to get the desired output?
Can someone please tell me what should be the format I need to use for the above scenario?
Regards,
Balaji.R
Discussion posts and replies are publicly visible
Hi Balaji,
I hope this code will help you.
rule!SPB_LMS_FL_textField(
label: "Balance",
isReadOnly: true(),
value:if(ri!exitBalance<0,
concat("-",pound(rule!returnPositiveDecimalNumber(ri!exitBalance))),pound(ri!exitBalance))
)
rule!returnPositiveDecimalNumber
-----------------------------------------------------------------------
if(
or(
rule!APN_isEmpty(
ri!decimalNumber
),
rule!checkIfDecimalNumberPositive(
ri!decimalNumber,
sqrt(
ri!decimalNumber * ri!decimalNumber
rule!checkIfDecimalNumberPositive
-----------------------------------------------------
ri!decimalNumber >= 0,
true(),
false()
Result
----------