I create a column, set its formula and set its data type
Then I call Recalc
Now for my problem, if I set the column datatype to Int32 and create a calculation that is between 2 decimal columns, the formula results show a decimal value. Is there anyway to format the values to make them an int or to round a decimal to a certain number of decimal places?
Version 2006.1
Thank you, Jamie
Hi Jamie,
Well... there's really no such thing as a "formatted value". Once you format the value, it becomes a string. I'm just nitpicking about symantics, but it's important to understand the implications of formatting. :)
Anyway. what you need to do here is use the Text property of the cell. If you want to then convert that text into a numberic value, you can probably just use the double.Parse method.
I'm not sure I understand the distinction you are making. The value returned from the Calculation is most like a double. So it's a numeric value. Formatting it implies that you are formatting the number for display as a string. You can't format a numeric value and still have it be numeric.
is there anyway to format it so that the value actually being returned from the calculation is formatted?
Use the Format property of the column.