Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

4
LINES

< > BotCompany Repo | #1007644 // formatDoubleFull - always show full number of digits

JavaX fragment (include)

static S formatDoubleFull(double d, int digits) {
  S format = digits <= 0 ? "0" : "0." + rep(digits, '0');
  ret new java.text.DecimalFormat(format, new java.text.DecimalFormatSymbols(Locale.ENGLISH)).format(d);
}

Author comment

Began life as a copy of #1007643

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007644
Snippet name: formatDoubleFull - always show full number of digits
Eternal ID of this version: #1007644/4
Text MD5: a8802783849bc698c8da5a39e8e416a1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-30 14:58:08
Source code size: 219 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 613 / 628
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1031935 - formatDouble3X - format made with 3 fixed digits