List:General Discussion« Previous MessageNext Message »
From:Daniel Kasak Date:December 18 2005 11:14pm
Subject:String Formatting
View as plain text  

I've got some time data that is in an unfortunate format - stripped of
colons and leading zeros, eg:

00:00:10 is simply:

00:02:00 is:

Nice, eh? Until today, I assumed that I had *seconds*, but apparently
not ...

Is there a formatting function that allows me to apply a formatting
template, eg:

string_format( my_string, 'dd:dd:dd )

d is 'digit' ... I'm clearly making this up as I go here. I've checked
the online docs, and I've found 'format' but it only seems to be for
numeric data.

Any ideas? Or do I have to piece together a big combo statement with
lots of if(), length(), locate() etc?

Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak@stripped

String FormattingDaniel Kasak19 Dec
  • Re: String FormattingSGreen19 Dec
    • Re: String FormattingDaniel Kasak19 Dec