3438
Views
7
Comments
How to format Input type currency with comma and decimal place 2
Question

I want to format the currency value in terms of comma & decimal in expression.


ex: 1234.556 will be 1,234.56

Thanks in Advance

Rank: #342

Hey assif_tiger,

You can use the build-in FormatCurrency() function for that.

Documentation: https://success.outsystems.com/Documentation/10/Reference/Logic/Built-in_Functions/Format_Built-in_Functions#FormatCurrency


Regards,

Sam

Rank: #411

Yes it is easy for expression you can do as Sam said above...but for input form it would be trickier....Just share my experience on this....

You can use help 1 extra variable and use of custom mask component.

Bind custom mask to this 1 variable and make this variable as variable for input widget.

Then don't forget to convert to necessary format when you do save action

Rank: #7027

Hi @Eric Halim! What's a custom mask component, if you could please elaborate

Staff
Rank: #407

Hello,


On an expression, you can use the system function 'FormatDecimal' where you can set the number of decimal places, the thousands separator character, and the decimal separator character. 

FormatDecimal(TextToDecimal("1234.556"),2,".",",")


On Inputs, for web applications, you can use the forge component Custom Masks and for mobile applications, you can use forge component Input Masks Mobile.


Hope it helps.


Regards,

DO

mvp_badge
MVP
Rank: #134

Hi,

Please use mask input for mentioned requirement.


Thanks!

Rank: #1457

To expand on this question..what if 123456 to $1234.56


Thank you,

FrankCLT

mvp_badge
MVP
Rank: #131

Hello FrankCLT,

You can use the built-in action FormatCurrency to do that. Please see the documentation here.

Note: I think you should create a new post because your question is different from the original post in 2018.

BR,

Luis


FrankCLT wrote:

To expand on this question..what if 123456 to $1234.56


Thank you,

FrankCLT