Hello,
Was trying to figure out how to best go about solving this problem. We have a customer who has prices that occasionally will need 3 decimal places. They want to print only when the 3rd decimal place is actually <> 0. So for example.
1.50
or
1.505
The first prints because the price is only $1.50, the second the price is $1.505. They want them to print exactly that way. Anyone seen anything on how to do this in .NET? Currently everything we have done in .NET requires it to either be 2 or 3 decimals, not a variable amount.
0
Comments
http://stackoverflow.com/questions/6092243/c-sharp-check-if-a-decimal-has-more-than-3-decimal-places
Detext if the decimal has 3 decimal places then format it that way (#.000) otherwise (#.00)
Does that help you?
EDIT: What do you mean by .NET Reports? RDLC Reports use ind Navision? If so we're talking about another thing
I read your question as:
If the number has 2 or less decimals I want to format is as X,XX (e.g 1,55 // 3,50 // 7,00)
If the number has 3 decimals (or more), I want to format the number as X,XXX (e.g 1,123)
The above can be done like this in .NET (C# and VB)
I'm not quite sure if this is what you were looking for, if not - just yell...
CTO, Architect - Microsoft Dynamics NAV
Yes, my apologies, so used to calling them .NET on our side, but I am talking about RDLC Reports for use in Nav 2009 R2.
if setting decimalplaces property is not working on classic and on rtc side, you are maybe using AutoFormatExpr which ignores the DecimalPlaces feature.
@ThomasHej_MSFT Thanks for the info! It must have been friday... ](*,) Of course this is the right way to do such thing in .net