Formatting Column of Times
alex at tweedly.net
Wed Sep 7 16:17:06 CDT 2005
Mark Smith wrote:
> See the entry for 'statRound' in the docs...
Yeah - but I wish there was a way to get this form of rounding in the
Hmmmm -an enhancement !! I'll request it .... BZ 3111 added
> On 7 Sep 2005, at 19:44, Alex Tweedly wrote:
>> Dom wrote:
>>> another example: to make the sum of a field, and to yield a formatted
>>> on closefield
>>> put the short name of the target into tfield replace comma with
>>> "." in fld tfield -- european currency delimiter ;-)
>>> put fld tfield into montants
>>> replace return with comma in montants
>>> put "S" & tfield into ttotal
>>> put format("%3.2f",sum(montants)) into fld ttotal
>>> end closefield
>> "european currency delimiter" reminds me .... you need to be cautious
>> about using format for currency values.
>> Many countries (e.g. UK) have rules about how rounding should be
>> performed on currency values in some circumstances; this is typically
>> NOT the same method as used by Rev.
>> Rev will round as needed to the specified number of places after
>> decimal point (i.e. 2 in the code above). The rounding used is such
>> that midway values (i.e. exactly '5' in the following position) will
>> round upwards (e.g. 0.125 --> 0.13, 0.135 -> 0.14, etc.)
>> The UK rules on currency conversion required that for such "midway"
>> values you should always round to the even valued adjacent value
>> (e.g. 0.125 -> 0.12, 0.135 -> 0.14) - which had the advantage of
>> balancing out the rounding amounts over a large enough set of values.
>> Alex Tweedly http://www.tweedly.net
>> No virus found in this outgoing message.
>> Checked by AVG Anti-Virus.
>> Version: 7.0.344 / Virus Database: 267.10.18/90 - Release Date:
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
Alex Tweedly http://www.tweedly.net
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.18/90 - Release Date: 05/09/2005
More information about the use-livecode