Numberformat

David Bovill david at openpartnership.net
Tue Aug 26 15:46:47 EDT 2008


I get a "8".

Here I've extracted this function:

function date_PadTwoZeros someNum
>     set the numberformat to "00.######"
>     put item 1 of someNum + 0 into padedNum
>     set the numberformat to "0.######"
>     return padedNum
> end date_PadTwoZeros
>
> put date_PadTwoZeros("8") --> "8"
>
> function date_PadTwoZeros someNum
>     if the number of chars of someNum = 1 then
>         return "0" & someNum
>     else
>         return someNum
>     end if
> end date_PadTwoZeros
>
> put date_PadTwoZeros("8") --> "08"
>



More information about the use-livecode mailing list