The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator Syncfusion Team 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).