kctvt

Errors decimal number when use Round ()

4 posts in this topic

#1 ·  Posted (edited)

 

Hi there, I have a small problem, and I dont know how to fix it. 

 

Example :  

Spoiler

 

$b = 1.09549

$a = 1.09548

$c = $b - $a

 

So, we know 1.09549 - 1.09548 ... will be : 0.00001 

But no, see this , look at this picture.   (Attach file)

That is : 1e-005   , NOT 0.00001

 

=====

I used ROUND ()  to fix this , but I cant.

$c1 = Round ($c,5)

 

So, any body please help me.  Thanks :)

 

 

 

 

 

number1.png

Edited by kctvt

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@kctvt,

you need to reformat the output, like this:

$b = 1.09549
$a = 1.09548
$c = $b - $a
MsgBox(0, '', StringFormat('%.5f', $c))

EDIT: to clarify, this is only a visual representation. the actual numeric value is correct, 1e-005 = 0.00001

Edited by orbs
1 person likes this

Share this post


Link to post
Share on other sites
21 hours ago, orbs said:

@kctvt,

you need to reformat the output, like this:

$b = 1.09549
$a = 1.09548
$c = $b - $a
MsgBox(0, '', StringFormat('%.5f', $c))

EDIT: to clarify, this is only a visual representation. the actual numeric value is correct, 1e-005 = 0.00001

Hi Orbs , it worked :) Thanks. You saved my life yesterday :) 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now