3
Good afternoon guys, I’m having a problem kind of ridiculous, but I can’t find the solution.
I’m trying some stringFormat
as StringFormat={}{0:#,#.00}}
and StringFormat=N2}
, besides StringFormat='c'
, but apart from the first that does not compile (I do not know why) the others insert 2 decimal places (value + 00), however I would like him to consider the last two value houses as being the cents.
<DataGridTextColumn Header="Valor Fator" Binding="{Binding
PendenciaValorFator, Mode=TwoWay, StringFormat=N2,
UpdateSourceTrigger=PropertyChanged}" IsReadOnly="False">
I am sending a decimal with this format: 728001 and it is showing 728.001,00, however I would like it to show 7.280,01.
Adding, I need to be sent a numerical value to the grid otherwise when doing the "order" it will do by string thus, putting first the value 1.111,11 instead of 999,99.
To show how you want the string has to be "7280.01"
– ramaral
I put in the database 7280,01 and 7280,01, the result was 728,001,00
– Denis
What is the type of
PendenciaValorFator
?– ramaral
I’m doing the test as decimal, because when I was using as a string it was ordering as a string, putting 1.111.11 in front of 999.99.
– Denis
I did not explain myself well in my first commit. What I meant is that for the value to be formatted like this:"7280.01", the value of
PendenciaValorFator
(decimal type) must have decimal places:PendenciaValorFator = 7280.01;
– ramaral
If you play 728001 the WPF will understand that is seven hundred and twenty eight thousand and one, and will format to 728001,00 or 728,001.00 according to the culture. You need to create a Converter to customize this;
– user26552
@ramaral if you want to put as answer, I will accept!
– Denis