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

10
LINES

< > BotCompany Repo | #1034894 // toDoubleOrNull

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

Libraryless. Click here for Pure Java version (5098L/28K).

static Double toDoubleOrNull(O o) {
  if (o == null) null;
  if (o cast Number)
    ret o.doubleValue();
  if (o cast BigInteger)
    ret o.doubleValue();
  if (o cast S)
    ret parseDouble(o);
  null;
}

Author comment

Began life as a copy of #1002175

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, iveijnkanddl, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034894
Snippet name: toDoubleOrNull
Eternal ID of this version: #1034894/1
Text MD5: d54ec9480af357d8eb7c1c1809bff1f4
Transpilation MD5: ae30ec0084130dd910c050fd8e3468cd
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-13 02:32:41
Source code size: 213 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 58 / 89
Referenced in: [show references]