Charalabos Michael
|
| Posted: 08/13/2008, 6:38 PM |
|
Hello,
Is there a way to format an Integer with leading zeros ?
Thank you
|
|
|
 |
wkempees
Posts: 1679
|
| Posted: 08/13/2008, 7:22 PM |
|
Help File, Search, "Number Format" or "Format"
will tell you how to use a field's property format to do jyust what you want.
Your desired output, assuming you want 8 digits: 00000000
To be set in the field Properties->Format.
OR
In BeforeShow of the field
$Component->SetValue(sprintf( "%08s\n",$Component->GetValue() ) ) ;
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
Charalabos Michael
|
| Posted: 08/13/2008, 8:37 PM |
|
Hello Walter,
> Help File, Search, "Number Format" or "Format"
> will tell you how to use a field's property format to do jyust what you want.
> Your desired output, assuming you want 8 digits: 00000000
> To be set in the field Properties->Format.
>
> In BeforeShow of the field
>
> $Component->SetValue(sprintf( "%08s\n",$Component->GetValue() ) ) ;
>
Thank you very much! I just donate you 10 EUR for all your help!
btw, sprintf function isn't document in the help file ;)
|
|
|
 |
wkempees
Posts: 1679
|
| Posted: 08/14/2008, 4:01 AM |
|
sprintf() is not CCS function but PhP function.
Thank you for donation.
Efcharisto file mo Michael.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
Charalabos Michael
|
| Posted: 08/14/2008, 4:01 PM |
|
Hello Walter,
> Efcharisto file mo Michael.
Nice! ... :) (you forgot a "u" on "mo" so, mo = mou)
|
|
|
 |
wkempees
Posts: 1679
|
| Posted: 08/14/2008, 4:43 PM |
|
Sorry 
Kalinichta Hellas
from Xenos Holland
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
|