Advertisement
Xgod22052

Untitled

Mar 22nd, 2021
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. command /test:
  2. trigger:
  3. send "%formatNum({%player%.beacons})%"
  4.  
  5. function formatNum(n: number) :: string:
  6. set {_l::*} to split "k,M,B,T,Qn,Qi,Sx" at ","
  7. set {_i} to min(floor(log({_n})/3), size of {_l::*})
  8. return "%{_n}%" if {_i} <= 0
  9. set {_i2} to 1000^{_i}
  10. return "%{_n}/{_i2}%%{_l::%{_i}%}%"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement