Perhaps this is really clumsy, but maybe this will help.  If not, the
others on the list will fix us right up.

until (length($a) - index($a, '.') < 8){
    $a = substr($a, 0, (length($a)-1))
}

Shawn




                                                                                       
                                                
                      prabhakn77@yahoo                                                 
                                                
                      .com                     To:      [EMAIL PROTECTED]             
                                                
                                               cc:                                     
                                                
                      10/22/2002 02:15         bcc:                                    
                                                
                      PM                       Subject: truncation of decimal places.  
                                                
                                                                                       
                                                
                                                                                       
                                                





Hi,

I have a really simple question.I have two numbers

say $a = 1.559999

$b=1.5599999999

how do I compare them to exactly 6 decimals without doing a round off.I
used sprintf but it does a round off.

thank you.



---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site






**********************************************************************
This e-mail and any files transmitted with it may contain 
confidential information and is intended solely for use by 
the individual to whom it is addressed.  If you received
this e-mail in error, please notify the sender, do not 
disclose its contents to others and delete it from your 
system.

**********************************************************************


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to