Hi,
I've had a previous thread
http://www.mibuso.com/forum/viewtopic.php?f=23&t=36144with great respsonses to the question.
I wanted to display leading zero's in a report for a 3 digit integer, e.g. text =5 display 005, text = 56 display 056, text =145 display 145.
Basically the solution was text := PADSTR('',3 - strlen(Text),'0') + Text;
Now I need to be able do the same thing with a decimal number. i.e. the integer portion is always 3 digits with zero padding any leading digits
e.g. text = 1.46, display 001.45
text =67.123 display 067.123
text = 145.7 display 145.7
I was thinking about the format command or do I need to pull apart the string to separate the integer/decimal.
Can anyone help?
Thanks
Answers
Object Manager
Thanks for the reply, but the decimal variable is a text data type.
The suggestion doesn't work on text fields.
Can it be done?
Thanjs
decText := COPYSTR(text,STRPOS(text,decimalSign),STRLEN(text));
text := DELSTR(text,STRPOS(text,decimalSign),STRLEN(text));
text := PADSTR('',3 - strlen(Text),'0') + Text + decText;
Thanks for the response... I wan't sure if the Format command could be used or if I had to pull apart the string.
Kind regards
Fred