>I get this error when dividing a currency value by zero. A normal numeric value will return asterisks. Example:
>
>? 1/0
>? $1/0
>
>
>Is there a setting that will make the currency values behave like normal numeric values? I am changing several of my fields from numeric to currency types, and bad data could cause some views with calculated fields (i.e. price/qty) to bomb.
>
>Thanks.
You can also get some other strange behavior with currency values. For example, one that caused me grief was more or less like this:
? round($1 * 0.12345, 3)
gives you 0.124, not 0.123. This is because the number is rounded twice - the first time, when converting to currency (or as the result of a calculation involving currency values).
In cases like these, it may help to convert to numeric, with mton(). (In the case you mentioned, this strategy would also give you an asterisk instead of an error.)
However, note that for additions and substractions, currency is MORE accurate, not less, than the standard floating-point numbers - provided 4 decimals is enough for your needs.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)