Home » U++ Library support » U++ Library : Other (not classified elsewhere) » rounding to decimals implementation
rounding to decimals implementation [message #44429] |
Wed, 11 March 2015 11:24  |
aftershock
Messages: 143 Registered: May 2008
|
Experienced Member |
|
|
Hi all,
I have not found that in the library.
Here is the implementation.
double roundd ( double n, int decimals )
{
double p = ipow10 ( decimals );
return floor ( n*p + 0.5 ) / p;
}
A.
|
|
|
Goto Forum:
Current Time: Sun May 11 11:49:33 CEST 2025
Total time taken to generate the page: 0.02531 seconds
|