<%=1/15%> retuns 6.66666666666667E-02

N

.nLL

This is a bit complicated than i expected. is there any function that
will help me to return proper result (like 0.06) from 1/15?

Thank you
 
B

Bob Barrows [MVP]

OK, a simple answer:
No.

The correctly rounded result is 0.07, so if you want the result to be
"0.06", you will need to write complicated code to round the result the
way you want to (why do you want to round down?).

There is no substitute to learning how to properly deal with f-p
arithmetic. This will not be the last time you encounter this.

For a simple answer, try the vbscript FormatNumber function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,796
Messages
2,569,645
Members
45,367
Latest member
Monarch

Latest Threads

Top