1 | static S formatDouble_significant2(double d, int digits) { |
2 | try { |
3 | digits -= Math.floor(max(-10, Math.log10(abs(d))+1)); |
4 | ret formatDouble(d, digits); |
5 | } on fail { |
6 | print("Had number: " + d + ", digits: " + digits); |
7 | } |
8 | } |
Began life as a copy of #1010031
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1018790 |
Snippet name: | formatDouble_significant2 - format with significant number of total digits |
Eternal ID of this version: | #1018790/11 |
Text MD5: | e5872f09514fe5ce7ef5911f418e1045 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-11-05 18:39:08 |
Source code size: | 239 bytes / 8 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 456 / 544 |
Version history: | 10 change(s) |
Referenced in: | [show references] |