[futurebasic] Re: [FB] Rounding

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1999 : Group Archive : Group : All Groups

From: Pierre Zippi <pzippi@...>
Date: Wed, 09 Jun 1999 09:06:12 -0500
Doug Hull wrote:
> 
> A very embarrassing question!  I am using FBII and I was wondering how to
> round a number to 2 digits?  I do not want this for all values in my program
> and this is not being used in say a print statement so I can not use using
> "###.##".  I looked in the help of FB but I cannot find what I want.
> 
> Example:
> >From  754.73906
> 
> To  754.73  or  754.74
> 
> Thanks,
> DH
> 
> --
> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>


Try this: INT(num#*100)\100

Example below:

LOCAL FN doWnd
  COORDINATE WINDOW
  TEXT _geneva, 12
  WINDOW 1, "Round", (0,0)-(250,100),_docNoGrow
END FN

'--- main

FN doWnd
num#=3.1/3
PRINT num#
PRINT INT(num#*100)\100

DO:UNTIL FN BUTTON
END

-- 
Pierre A. Zippi

+++++++++++++++++++++++
Home email: paz@...
Home web: http://web2.airmail.net/paz