CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Leading Zeros ?

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.