The problem is that str(number) returns scientific notation for numbers greater than 6 digits. This means that I must test the number without using the str function. The example below (Num1 mod Num2) only works for integers. Since my numbers can be integer or decimal, I don't think the Mod operator can be used to test for a fractional part. Is there a function that returns only the fractional part of a number?
Barrie
On Jan 20, 2006, at 1:09 AM, John Kubie wrote:

I think you're right -- you have to test whether there is a fractional part. I'm not sure what calculation you are doing. If it's division, you could do something like this:

if Num1 mod num2 = 0 then
  editfield1.text=format(num1/num2,"#")
else
  editfield1.text=format(num1/num2,"#.##")
end if


On Jan 20, 2006, at 12:55 AM, Barrie Jones wrote:

John, many thanks. My numbers can be both decimal and integer so I use a format string "########.##" but integer numbers are displayed with a decimal point at the end. Do I have to manually remove the point? That seems a bit crude.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to