help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Taking the nearest decimals possible


From: Doug Stewart
Subject: Re: Taking the nearest decimals possible
Date: Wed, 22 Apr 2020 17:19:52 -0400



On Wed, Apr 22, 2020 at 5:11 PM GK19 <address@hidden> wrote:

Hi,
I have a query
i have 3 number
1] 1.6778
2] 2,032
How do i take the number 1.6778 to 1.7 (nearest value)
and 2.032 to 2.0?


One way (and there are many ways)
take your number and multiply by 10 
then take the integer part
then divide by 10

a=1.6778
b=(round(a*10))/10

--
DASCertificate for 206392


reply via email to

[Prev in Thread] Current Thread [Next in Thread]