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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GDBG - NumberFormat - Exponent

Thread ID:





15951 Jul 1,2004 05:22 AM UTC Jul 1,2004 06:13 AM UTC WinForms 1
Tags: GridControl
Daniel Roesch
Asked On July 1, 2004 05:22 AM UTC

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 06:13 AM UTC

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).


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon