[futurebasic] Re: [FB] Round Double-precision val?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1998 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Thu, 31 Dec 1998 20:13:08 +0100
Morrison SoftDesign wrote:

> Does anyone have a quick way to round up to the nearest 10ths a given
> dbl val?
>
> like:
>
> myDouble# = 123.4567
>
> ..round up somehow...
>
> myNewDouble# = 123.46

Hi John,

Maybe you could define a function that performs the task, but probably there
is a fastest way that I don't know.

DEF FN round#(number#) = VAL(USING "###.##";number#)

WINDOW 1
myDouble# = 123.4567
myNewDouble# = FN round#(myDouble#)

PRINT myNewDouble#
DO
UNTIL FN BUTTON OR LEN(INKEY$)


Alain