Negative Numbers and NumberFormat

Paul Dupuis paul at researchware.com
Thu Apr 6 17:26:20 EDT 2017


On 4/6/2017 5:04 PM, Bob Sneidar via use-livecode wrote:
> put format("00:00:00", "9:50:00") produces 00:00:00. 
> put format("##:##:##", "9:50:00") produces ##:##:##. 
> put format("nnn.nnn.nnn.nnn", "192.168.1.1") produces nnn.nnn.nnn.nnn

put format("%2d:%02d:%02d", 9,50,0) produces 9:50:00

put format("%02d:%02d:%02d", 9,50,0) produces 09:50:00

put format("%0d.%0d.%0d.%0d",192,168,1,1) produces 192.168.1.1

put format("%03d.%03d.%03d.%03d",192,168,1,1) produces 192.168.001.001

I am not sure there is any delimited set of strings or numeric
information you can't format. I do get that "00:00:00" is more intuitive
than "%02d:%02d:%02d", which is why I suspect it is just the learning
curve of understanding the syntax of the format function that prevents
more people from using it.





More information about the use-livecode mailing list