Libraryless. Click here for Pure Java version (10069L/55K).
sS reformatFloatingPointNumbers(S s, int decimals default 2) { ret regexpReplace(s, "\\b" + regexpForFloatingPointWithoutSign(), matcher -> formatDouble(parseDouble(matcher.group()), decimals)); } sS reformatFloatingPointNumbers(int decimals, S s) { ret reformatFloatingPointNumbers(s, decimals); }
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1036344 |
| Snippet name: | reformatFloatingPointNumbers |
| Eternal ID of this version: | #1036344/2 |
| Text MD5: | cbb9dce47932625f3ad79c67797e0c97 |
| Transpilation MD5: | ecc3db91c86c24d096ae59e9aa48f091 |
| Author: | stefan |
| Category: | javax / maths |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-12-15 22:58:55 |
| Source code size: | 315 bytes / 8 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 440 / 563 |
| Version history: | 1 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |