eric_h - Friday, September 16, 2011 12:29 PM:
I was wondering if anyone had any thoughts about storing numeric values in Aras, in particular anything with a decimal value.
I realize that whatever data type is picked fits within the constraints of SQL Server. Here is what I have figured so far:
Decimal - is precise, but you will get trailing zeros after (to the right of) the decimal point as far out as the assigned precision.
Float - does not have the issues with the trailing zeros, but cannot be guaranteed to be precise.
I am wondering what most people do here. Is there a function to truncate off the trailing zeros for anything that is displayed for Decimals? I suppose I could write a JavaScript function to handle this. Or does anyone know to what point Floats are guaranteed to be precise before they become estimations, meaning how many places to the right of the decimal before they become imprecise (knowing of course that part of this may depend on how many digits fall to the left of the decimal point)?
Thanks,
Eric
Brian - Tuesday, September 27, 2011 8:08 AM:
Hi Eric,
Well I guess it depends what you want.
Accuracy is usually important to everyone in storing the numbers.
Just format the result to be what you want the user to see.
For this you might want to look at the "toFixed(x)" method in Javascript.
Cheers,
Brian.