Please provide a sample number (val) that gets the padding you don't want.
 
I would like to use this number to see if I can get the function work the way 
you want it to.XFX nForce 680i LT SLI Socket 775 | Intel Core 2 Duo E6750 
OC:1600 FSB @ 3.2 MHz | 2 x OCZ SLI 1024MB PC6400 DDR2 800MHz| XION 600w PSU | 
CM Stacker 200 ATX/BTX Case | EVGA GeForce 8800 GTS 512 | WD SATA 74 GB Raptor 
(boot/system), WD SATA 500 GB (storage) | Windows XP Pro, SP3 | Patient and 
supportive significant other



To: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Sun, 10 Aug 2008 00:05:27 
-0700Subject: [advanced_delphi] FloatToStrF without zero padding




Greeting,Did anyone know how to use FloatToStrF without zero padding? I need it 
because my code must avoid the usage of scientific notation, thus I used 
FloatToStrF with ffFixed format. But later I found out that the output of 
resulted string was padded with zeros. For temporarily, I use these code to 
remove all zero padding but still there must be some way which is more 
efficient...---code begin---function TDMod.FloatToStrNP(val : extended) : 
string ;vara : integer ;txt,retval : string ;begintxt := 
FloatToStrF(val,ffFixed,18,18) ;retval := '' ;for a:=Length(txt) downto 1 
dobeginif (txt[a]='0') and (retval <> '') then retval := txt[a]+retvalelse if 
txt[a]<>'0' then retval := txt[a]+retval ;end ;Result := retval ;end;---code 
end------------------------CoolKid K-Qhahttp://kha.web.id--------------------- 





_________________________________________________________________
Got Game? Win Prizes in the Windows Live Hotmail Mobile Summer Games Trivia 
Contest
http://www.gowindowslive.com/summergames?ocid=TXT_TAGHM

Reply via email to