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

4
LINES

< > BotCompany Repo | #1036344 // reformatFloatingPointNumbers

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9816L/54K).

sS reformatFloatingPointNumbers(S s, int decimals default 2) {
  ret regexpReplace(s, "\\b" + regexpForFloatingPointWithoutSign(), 
    matcher -> formatDouble(parseDouble(matcher.group()), 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/1
Text MD5: fd5053eddd66623daf2d85dfcf1e92c0
Transpilation MD5: 91571aab621aa665fb5f27a6d0c6d9fc
Author: stefan
Category: javax / maths
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-11-21 11:14:56
Source code size: 206 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 5 / 15
Referenced in: [show references]