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

7
LINES

< > BotCompany Repo | #1012012 - formatInt - format an int (or long) with fixed number of digits

JavaX fragment (include)

static S formatInt(int i, int digits) {
  ret padLeft(str(i), '0', digits);
}

static S formatInt(long l, int digits) {
  ret padLeft(str(l), '0', digits);
}

Author comment

Began life as a copy of #2000590

download  show line numbers  debug dex   

Travelled to 9 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1012012
Snippet name: formatInt - format an int (or long) with fixed number of digits
Eternal ID of this version: #1012012/3
Text MD5: b3ecc82f6dad3b82968eb1958092ab08
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-16 02:24:27
Source code size: 163 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 180 / 198
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1012012 & http://1012012.tinybrain.de