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
]
10/22/2002 02:41 bcc:
PM Subject: Re: truncation of decimal
places
Naveen Prabhakar wrote:
>
> Hi,
>
> I have a really simple question.I have two numbers
>
> say $a = 1.55
>
> $b=1.55
>
> how do I compare them to exactly 6 decimals without doing a round off.I
> used sprintf but it does a round off.
>
i don't know why you would want to do that b
10/22/2002 03:36 bcc:
PM
On Tue, Oct 22, 2002 at 11:15:02AM -0700, naveen prabhakar wrote:
>
> Hi,
>
> I have a really simple question.I have two numbers
>
> say $a = 1.55
>
> $b=1.55
>
> how do I compare them to exactly 6 decimals without doing a round
> off.I used sprintf but it does a round off.
>
> th
Naveen Prabhakar wrote:
>
> Hi,
Hello,
> I have a really simple question.I have two numbers
>
> say $a = 1.55
>
> $b=1.55
>
> how do I compare them to exactly 6 decimals without doing a round off.I used
> sprintf but it does a round off.
s/(?<=\.\d{6})\d+// for $a, $b;
if ( $a
ahnj@;acm.org]
Sent: Tuesday, October 22, 2002 1:28 PM
To: [EMAIL PROTECTED]
Subject: Re: truncation of decimal places.
Naveen Prabhakar wrote:
>
> Hi,
Hello,
> I have a really simple question.I have two numbers
>
> say $a = 1.55
>
> $b=1.55
>
> how do I co