Conversion of value from the database to monetary value with error

Asked

Viewed 35 times

0

In the database(SQL) I have a field called Valor which is a decimal and contains the following value: 21581 that would be R$215.81

But in doing the casting of this value he is returning

$"{reader["valor"]:c}"
"R$ 21.581,00"
  • 1

    C#?? Split by 10, no?

  • @Ls_dev not, for 100, thanks for the tip.. was a north for the resolution

1 answer

0

The conversion is correct.

For the converted value to be R$215.81, should be recorded at the base as 215.81

Browser other questions tagged

You are not signed in. Login or sign up in order to post.