Re: Trailing Zero Suppression

2002-04-04 Thread Michael D Mays

Use the numberFormat property.
 set the numberFormat to .
will show 8 digits to the right of the decimal unless they are a trailing
zero.

Note that you have to perform a mathematical operation on the number before
displaying it.

 set the numberFormat to .###
 put 1.2300

would display 1.2300 in the message box.

 set the numberFormat to .###
 put 1.2300+0

would display 1.23

michael


Richard Harrison of [EMAIL PROTECTED] wrote the following on 4/3/02
11:07 PM

 Hi there,
 
 Does anyone have a good trailing zero suppression
 routine for eliminating trailing zeroes from decimal numbers?

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Trailing Zero Suppression

2002-04-04 Thread Richard Harrison

on 4/4/2002 7:41 AM, Michael D  Mays at [EMAIL PROTECTED] wrote:

 Use the numberFormat property.
...
 
 set the numberFormat to .###
 put 1.2300+0
 
 would display 1.23
 
 michael
 

Michael,

Thanks, I'll give that a try.

The Revolution documentation certainly wasn't very clear
about this.

Thanks again,

Rick Harrison


___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Re: Trailing Zero Suppression

2002-04-04 Thread Richard Harrison

on 4/4/2002 4:03 AM, Chipp Walters at [EMAIL PROTECTED] wrote:

 Rick,
 
 Try this (or someting like it)
 
 on mouseUp
 put killTrail(5123.54001000)
 end mouseUp
 
 function killTrail val
 if val contains . then
 if last char of val is in 123456789. then
 return val
 else
 delete last char of val
 return killTrail(val)
 end if
 else
 return no decimal number here
 end if
 end killTrail

Chipp,

Thanks for the info.

I'm thinking that Michael Mays following solution
might be a little better.

 set the numberFormat to .###
 put 1.2300+0
 
 would display 1.23
 
 michael

Thanks anyway, I appreciate the effort!

Rick Harrison

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



Trailing Zero Suppression

2002-04-03 Thread Richard Harrison

Hi there,

Does anyone have a good trailing zero suppression
routine for eliminating trailing zeroes from decimal numbers?

Thanks,

Rick Harrison

___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution



RE: Trailing Zero Suppression

2002-04-03 Thread Chipp Walters

Rick,

Try this (or someting like it)

on mouseUp
  put killTrail(5123.54001000)
end mouseUp

function killTrail val
  if val contains . then
if last char of val is in 123456789. then 
  return val
else
  delete last char of val
  return killTrail(val)
end if
  else
return no decimal number here
  end if
end killTrail

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]On Behalf Of Richard
 Harrison
 Sent: Wednesday, April 03, 2002 11:08 PM
 To: [EMAIL PROTECTED]
 Subject: Trailing Zero Suppression
 
 
 Hi there,
 
 Does anyone have a good trailing zero suppression
 routine for eliminating trailing zeroes from decimal numbers?
 
 Thanks,
 
 Rick Harrison
 
 ___
 use-revolution mailing list
 [EMAIL PROTECTED]
 http://lists.runrev.com/mailman/listinfo/use-revolution
___
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution