I have an UltraGridColumn with a datatype of "text" and a formula of string "2513694865213849663". When the CalcManager finishes its calculation I end up with String: "2.51369486521385E+18".
This blows an error in my application as I need this to be a string value with all numeric characters. Any way to make the CalcManager realize this should be treated as text and not numeric? I figured that by making the datatype of the column text this would solve it but evidently not.
I'm a little confused. What is the formula being applied to? A grid cell?
You would probably be better off making the cell a Double of a Decimal type rather than a string, but it's hard to say without knowing exactly what you are doing, where the value comes from, and where it's being written to.
Yes the formula is being applied to a grid cell. The data type needs to be a string because there cannot be a limitation on the number of numeric values entered. No matter how big the value, it must stay in the format it is inputted in and not convert to scientific notation.
Oh.. I got sidetracked a little bit there, but the point I was getting at is that if the column were a numeric type like double, you would be able to use the Format property on the column. You would still be limited to a certain number of significant digits (I think double supports up to 15), but you would be able to get rid of the scientific notation.
Hi,
jake90210 said:The data type needs to be a string because there cannot be a limitation on the number of numeric values entered.
If you are using the value in a formula, then there will always be a limitation on the number of digits you can use. Storing the value as a string will not allow the UltraCalcManager to defy the constraints of the data types in DotNet. As it happens, UltraCalcManager uses doubles for all calculations, so you will be limited to the limitations of the double data type.
Unless you mean your calculations are only dealing with string manipulations and are not using any mathematical functions or operators.
The CalcManager does not actually convert anything to scientific notation. My guess is that what is happening here is that the value is being returned as a double and the grid column is a string, so it's calling ToString on the value and the default implementation of double.ToString is converting to scientific notation because the value exceeds the maximum precision of a double.