How to import the rounded amount? (as a decimal)

Hi to all,
I would need to import an amount to the DB, rounded to two decimal places.
The figure is read from an excel sheet.
The column is formatted as Number, with 2 decimal places.
In the excel bar, the number actually contains several digits after the comma.

image

I would like to import the rounded amount into the DB to 2 decimal places.

At the moment I have built the table. The “amount” column is formatted as “DECIMAL”.
I collect the element as a String, and when I add it to the table I convert it to decimal. “convert.todecimal …”.

The Flow does not go into error, but on DB I get this result !!
image

Can anyone help me in this step?
Thanks
Aaron

Hi,

It seems decimal point matter.
For now, can you try the following expression?

Math.round(Convert.ToDecimal(strData.Replace(",",".")),2,MidpointRounding.AwayFromZero)

Regards,

WoW! it works!
Thanks a lot Yoichi.
Yesterday I spent 10 hours doing tests and always failing!

Thank you very much.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.