Numberformat

Mark Smith lists at futilism.com
Tue Aug 26 16:44:26 EDT 2008


David, you need "%02d".

Best,

Mark

On 26 Aug 2008, at 21:20, David Bovill wrote:

> 2008/8/26 Mark Smith <lists at futilism.com>
>
>> The docs say "It affects numbers only when they are calculated and  
>> then
>> displayed or used as strings."
>>
>> I found that if you use <put item 1 of someNum + 0 into word 1 of  
>> padedNum>
>>
>> this forces padedNum to be a string, and you get '08'
>>
>> I've always found the numberFormat thing confusing, so I always use
>> 'format' in these cases...
>
>
> Hi mark -  I'm moving over  a date function to use "format" - but  
> in the
> docs I could not figure how to make it add trailing zeros? "%2d"  
> did not
> seem to work:
>
>         if extended is true then
>             -- 1981-04-05T14:30:30-05:00
>             put "%4s-%2s-%2sT%2s:%2s:%2s-%4s" into baseString
>         else
>             -- 19810405T14:30:30-05 00
>             put "%4s%2s%2sT%2s:%2s:%2s %4s" into baseString
>         end if
>
>         put format(baseString, y, mons, d, h, mins, s, z) into fDate
>
>  What should I usee?
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list