Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Function to truncate too much decimals
a guest
Jul 20th, 2013
556
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Java
0.16 KB
| None
|
0
0
raw
download
clone
embed
print
report
static
public
double
truncateDecimals
(
double
n,
int
numberOfDecimals
)
{
return
Math
.
floor
(
n
*
Math
.
pow
(
10
,numberOfDecimals
)
)
/
Math
.
pow
(
10
, numberOfDecimals
)
;
}
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
53 min ago | 13.41 KB
Untitled
1 hour ago | 9.46 KB
Untitled
2 hours ago | 12.60 KB
Untitled
3 hours ago | 11.80 KB
Untitled
4 hours ago | 16.76 KB
NovaGente CLS reccomendations
5 hours ago | 5.12 KB
Untitled
5 hours ago | 10.39 KB
Untitled
6 hours ago | 28.09 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!