2933
Views
7
Comments
Solved
Currency vs. Decimal
Question

Hi,

What is the difference between Currency and Decimal data types? "Available Data Types" topic in OS Help says nothing about it. It would seem that Currency should have by design 2 decimal places but the default value for Currency is (there) 0.0 and the example - 545870.025.....Regards

Tomasz


2012-03-02 13-17-21
Paulo Ramos
Staff
Solution

They are essentially the same. However, having a currency entity attribute will help you a bit while doing scaffolding patterns, as these fields will be automatically formatted as currency. And it kind of helps to document your data model, as you're adding a bit more information about the role of a specific attribute.

2016-04-21 20-09-55
J.
 
MVP

Good point.

the 0.0 is probably because of the trimming and you always need to format it anyways.

The example might be because of rounding/calculations, because it is a currency. You really don't want to lose decimals while calculating amounts.

Actually I rarely use Currency because of that and use Decimal anyways.

I will ask my little birds to explain it a bit more

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Barong,

That is not particularly helpful, as the Platform doesn't use MONEY in the database.

2012-03-02 13-17-21
Paulo Ramos
Staff
Solution

They are essentially the same. However, having a currency entity attribute will help you a bit while doing scaffolding patterns, as these fields will be automatically formatted as currency. And it kind of helps to document your data model, as you're adding a bit more information about the role of a specific attribute.

UserImage.jpg
Tomasz M Lipinski

OK. This makes sense.

Regards

Tomasz


UserImage.jpg
sai charan

Does currency datatype in Outsystems takes care of currency conversion or any in built functions as such?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Sai,

No, "Currency" is basically the same as "Decimal".

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.