Programing style

Hershel Fisch hershf at rgllc.us
Thu Nov 16 17:32:26 CST 2006


On 11/16/06 4:58 PM, "John Craig" <jc at spl21.net> wrote:
> Here's a snippet that will format with the thousand seperators;
> 
> put 12345678.567 into tVal
> set itemDel to "."
> put item 1 of tVal into tInt
> put "." & item 2 of tVal into tDec
> repeat with i = length(tInt) - 3 to 1 step -3
> if i > 0 then put "," after char i of tInt
> end repeat
> put "$" & tInt & tDec into tResult
> 
> The output is : $12,345,678.567
> 
> Hope this is some help
> 
Yes it did, very nice code.
Just don't understand the repeat header.
"to 1 step -3"
Thanks, Hershel




More information about the use-livecode mailing list