Libraryless. Click here for Pure Java version (81L/1K).
1 | sS formatDouble_roundUp(double d, int digits) { |
2 | S format = digits <= 0 ? "0" : "0." + rep(digits, '#'); |
3 | java.text.DecimalFormat df = decimalFormatEnglish(format); |
4 | df.setRoundingMode(RoundingMode.UP); |
5 | ret df.format(d); |
6 | } |
Began life as a copy of #1007643
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1031102 |
Snippet name: | formatDouble_roundUp |
Eternal ID of this version: | #1031102/1 |
Text MD5: | fe952b4287ba28b9aa0e9723955f027e |
Transpilation MD5: | e9b12a9d1c672922014b188d1e50f5eb |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-05-02 02:20:03 |
Source code size: | 234 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 166 / 258 |
Referenced in: | [show references] |