We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GDBG - NumberFormat - Exponent

Thread ID:

Created:

Updated:

Platform:

Replies:

15951 Jul 1,2004 01:22 AM Jul 1,2004 02:13 AM Windows Forms 1
loading
Tags: GridControl
Daniel Roesch
Asked On July 1, 2004 01:22 AM

Hi! In our grid (GridDataBoundGrid) we have some floats and doubles displayed. When they reached a certain size they are displayed with an exponent E. I tried to set the CulterInfo on the TableStyle property and defined the NumberFormat. But that seems not to work. The numbers are still displayed with an exponent. How can I get rid of that E? code: this.grid.TableStyle.CultureInfo = new CultureInfo( "de-CH", true ); this.grid.TableStyle.CultureInfo.NumberFormat.NumberDecimalDigits = 8; this.grid.TableStyle.CultureInfo.NumberFormat.NumberGroupSeparator = "''"; this.grid.TableStyle.CultureInfo.NumberFormat.NumberGroupSizes = new int[] { 3 }; Cheers! Dan

Administrator [Syncfusion]
Replied On July 1, 2004 02:13 AM

You can set grid.TableStyle.Format to control how numeric CellValueTypes are displayed. Some sample format strings you could try are "F", "F4", "#.###", "0.000", "#.0000", or "#.#####################". Now the number of significant digits displayed will conform to the the Type, roughly 7 digits for floats and 14-15 digits for doubles. So, if your user types 10 significant digits into a float cell, then he will lose some of the significance when the string value inputted is converted to a float value for storing, and the display will be affected. If you do not want this, then I think you would have to change the CellValueType to string, and the formatting would not be applied (as style.Format only affects non-string CellValueTypes).

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;