139
Views
2
Comments
Solved
Currency attribute data type in .NET
Question

Hi there,


I have a structure with several attributes and I'm building a Record List out of it to send inside an extension.

In the extension I need to check for every attribute if it is a Currency type attribute.

However, apparently OutSystems handles Currency as a Decimal, so my idea to get my answer through Reflection got dumped. -.-''

Is there any other way to check for Currency type?

If that's not possible, I'll have to workaround it with attributes' naming conventions...not cool, but we have to live with it. :)


Thanks!

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

João,

You are not mistaken decimal in C# is the data type to store money values.

The decimal has more significant figures than the double, therefore it can be more precise- it also takes up slightly more memory. 

Regards,

Daniel

2019-09-17 09-11-00
João Pedro Abreu
Staff

If I'm not mistaken, currency is the same as a decimal, both in .NET and in the database. I believe it's a type in OutSystems just for the platform to be able to apply some automatic validations and formatting options. The same thing applies to the Email type, which is just a Text.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

João,

You are not mistaken decimal in C# is the data type to store money values.

The decimal has more significant figures than the double, therefore it can be more precise- it also takes up slightly more memory. 

Regards,

Daniel

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