Anyone who's spent some time with Crystal Reports surely knows the value of converting between data types, especially when your back-end database isn't using the types we'd like. (If you've ever tried to summarize a string field you know what I'm talking about!)
Enter in the heroic TOTEXT() Crystal function. Passing a value to this function will return the numeric equivalent.
TOTEXT(123.45) returns "123.45"
TOTEXT(000045) returns "45"
You'll notice that ToText drops any leading zeroes, but maintains the decimal precision.
To go the Other Way (from Text to Numeric), simply use the TONUMBER() function, like this;
TONUMBER("123.45") returns 123.45
TONUMBER("$123.45") returns 123.45
TONUMBER("Cost: $123.45") returns an Error, as the source value must be "like a" Number
Of course, all formatting issues aside, the real reason we want to convert is usually to allow for easy summaries (i.e. running totals) or to "cut out" portions of a number as a string.