The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Currency rounding inconsistencies
Posted: 16 Sep 08 10:31 AM
|
View 1: Data grid with currency column. The format is manually defined: col.DisplayFormat = "$,0.00;-$,0.00"
View 2: group view with data format of Currency.
Data stored in DB: 30221.685
V1 displays the data as: $30221.69 V2 displays the data as: $30221.68
It's only a penny but I need to resolve the rounding problem either way. It doesn't matter if we round up or down as long as we are consistent.
Thoughts/ideas? |
|
|
|
Re: Currency rounding inconsistencies
Posted: 16 Sep 08 4:22 PM
|
If the data is 30221.695, what do the two views return?
The standard for rounding is round-even, where .5 gets rounded to the nearest even number. V1 definitely does not do that. If V2 does round-even, then I'd suggest going with that. |
|
|
|
Re: Currency rounding inconsistencies
Posted: 17 Sep 08 7:47 AM
|
The problem is that BOTH views are currently in use. I cannot change V2 so I was hoping someone would know what the custom format code would be to correct my V1 issue. |
|
|
|
Re: Currency rounding inconsistencies
Posted: 17 Sep 08 9:14 AM
|
I think there is a format property of the column in a datagrid where you can set the SLX format type to use. Did you try something like grdcontacts.Columns.Item(1).FormatType = ftcurrency? |
|
|
| |
|
Re: Currency rounding inconsistencies
Posted: 17 Sep 08 9:26 AM
|
Marc,
Is it possible that V2 is actually truncating as opposed to rounding? Are there any calculations or setting data to variables before the data is displayed?
Carla |
|
|
|
Re: Currency rounding inconsistencies
Posted: 17 Sep 08 9:36 AM
|
Without the formattype property set, what does it display? Does it contain $ and commas? It might be that the ftcurrency format type only excepts numeric and "." as valid data to translate. |
|
|
|