15
Views
13
Comments
Solved
decimal value
Question
Application Type
Reactive

HI 

i have currency value,and suppose amount is 500 but as per statndard i have to show as$500.00.is it possible with format currency ?can u please help me to solve this.

Rank: #55
Solution

Hi Arkyadeep,


Can you try the assign with the instructions below?

FormatCurrency(YourValue,"$", 2, ".", "")


This is how I get when I try it which is what you want, right?


Regards,
João

Sorry i forgot to mention one point.i am trying to achive in Traditional web application and the value is coming through input parameter.i am attaching the oml file.can u please tell me what i am doing wrong?

in oml file page is Test.aspx and you can pass the treatment amount only 200 but it is not showing $200.00

SandboxArkyaTraditional.oml

Rank: #55

Hi Arkyadeep,


On the expression where you are placing this:

You should replace by this:


Take a look at the description on the right on how to use FormatCurrency to achieve your use case if you need to do any change.


You will just need to apply the same principle to all your currencies.

As a good practice, you can isolate your format options (Number of decimal places, decimal separator, Currency Symbol, etc.) in site properties so if you want to change them you just need to change the site property instead of all your expressions.


Regards,
João

I have done already for treatment amount.but it is not working

Rank: #55

I see it working as you want, screenshot when total fee for treatment value has decimal places:


Screenshot when total fee for treatment value has no decimal places:

Rank: #86
Solution

Hello Arkyadeep,

Hope you're doing well.

Yes, that is possible using FormatDecimal() built-in function. Something like this should do the trick:

FormatCurrency(YourValue, "$", 2, ".", "")


Hope that this helps you!


Kind regards,

Rui Barradas

I have amount only 500 but it will automatically add .00 after 500.if ihave 500.25 then it is ok but how to handle only 500

Rank: #86

Hello Arkyadeep,

Can you explain your question a little more?


With the given expression, this will be the outcome:

  • For value 500 -> $500.00
  • For value 500.25 -> $500.25


Kind regards,

Rui Barradas

Rank: #55


Hi Arkyadeep,


You can try:


if(mod(<YourValue>,1) = 0, FormatCurrency(<YourValue>, "$", 0, ".", ""), FormatCurrency(<YourValue>, "$", 2, ".", ""))

I have currency data type.when I am getting amount 500$ then I have to show $500.00 and I have data with decimal value $500.25 then it will automatically come.how to handle only $500


Rank: #86

So you only want to show the decimal digits if your number has a decimal part, otherwise you don't.


You can also try something like:

If(YourValue = Round(Yourvalue), FormatCurrency(YourValue, "$", 0, "", ""), FormatCurrency(YourValue, "$", 2, ".", ""))


With this expression, this will be the outcome:

  • For value 500 -> $500
  • For value 500.25 -> $500.25


Kind regards,

Rui Barradas

no if i dont have decimal value then i have to show .00 like suppose i am getting only 500 then i have to show $500.00 and if i am getting $500.25 then i have to show $500.25.



FormatCurrency(YourValue, "$", 2, ".", "") it is not working
Rank: #55
Solution

Hi Arkyadeep,


Can you try the assign with the instructions below?

FormatCurrency(YourValue,"$", 2, ".", "")


This is how I get when I try it which is what you want, right?


Regards,
João

Sorry i forgot to mention one point.i am trying to achive in Traditional web application and the value is coming through input parameter.i am attaching the oml file.can u please tell me what i am doing wrong?

in oml file page is Test.aspx and you can pass the treatment amount only 200 but it is not showing $200.00

SandboxArkyaTraditional.oml

Rank: #55

Hi Arkyadeep,


On the expression where you are placing this:

You should replace by this:


Take a look at the description on the right on how to use FormatCurrency to achieve your use case if you need to do any change.


You will just need to apply the same principle to all your currencies.

As a good practice, you can isolate your format options (Number of decimal places, decimal separator, Currency Symbol, etc.) in site properties so if you want to change them you just need to change the site property instead of all your expressions.


Regards,
João

I have done already for treatment amount.but it is not working

Rank: #55

I see it working as you want, screenshot when total fee for treatment value has decimal places:


Screenshot when total fee for treatment value has no decimal places: