FormatCurrency function returns a Text value and you assigned it to a Currency data type variable.
After conversion, the formatted value must go into a given currency type. How could I do it?
Hi Gaetano,
That's not how it works. A currency is just a decimal value, it's a number. Formatting is something you do once you want it displayed.
Also, you are doing a TextToDecimal of TaxableIncome, but TaxableIncome should already be a Decimal or Currency!
You cannot save in the database that formatted text as a currency.
You have several options:
I put into the currency variable the value of my getinvoicebyid etc... variable, which is also of type currency.
Changing the database data type to text is also a pretty bad idea :D
I have to ask, do you have any programming experience? Because data type conversion is pretty basic programming stuff.
What the error says ("'Currency' data type required instead of 'Text') pertains to the Expression as a whole - if the error is about parts of the Expression, it underlines that part with squiggly lines.
So in this case, the error means that the result of the Expression is Text (which it is, FormatCurrency outputs Text), but you try to assign it to a variable of type Currency (outside the Expression editor), and that doesn't work.
Hi gaetano cerciello,
Just need clarification, what is datatype of Taxable income attribute.
Regards,
Ellakkiya.S
currency
So in that case there's no need for a "TextToDecimal", as that doesn't make sense at all. Also, like I said, you cannot store a formatted currency in the database, that's not how it works!
As Kilian Hekhuis said, To format the currency no need of TextToDecimal convertion.
Why does it give me an error?
I already told you. Please read all replies.