Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Truncate Decimals
theartoftrading
Aug 17th, 2021
598
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Java
0.17 KB
| None
|
0
0
raw
download
clone
embed
print
report
// Truncate() truncates a given number
// to a certain number of decimals
truncate
(
number, decimals
)
=>
factor
=
pow
(
10
, decimals
)
int
(
number
*
factor
)
/
factor
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
December smells like money
CSS | 4 min ago | 0.39 KB
✅ Changelly.com Exploit
18 min ago | 0.39 KB
Trading method
CSS | 33 min ago | 0.39 KB
Google Docs - Exploit
47 min ago | 0.39 KB
December smells like money
CSS | 56 min ago | 0.39 KB
Mod Archive - Lecture automatique
JavaScript | 6 hours ago | 6.94 KB
Untitled
10 hours ago | 1.01 KB
coding and writing poetry
17 hours ago | 1.27 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!