Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Need Decimals to be shown As Is
posted

XamDataGrid is not showing decimals as they are in the bound entities.

As an example, below table shows the actual value in the entity and the value shown on grid

Actual ValueValue Shown in Grid
1.123 1.1230
1.1 1.10
1.12 1.12

If the fractional decimals are odd in number, it appends a zero. (See the first two records)

If the fractional decimals are even, then it shows as it is. 

My requirement is, whatever be the fractional digits, they should be shown as they are instead of default appending zero. Please let me know how to achieve this.

Thanks in advance.

  • 34510
    Offline posted

    Hi Manik,

    Just binding a 'decimal' type property to the Field doesn't seem to reproduce this behavior, but you can set a format on the Field so that it will show the number as is.  Set the Format property to "G" and the number should show as it is inside the underlying data.