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

13
LINES

< > BotCompany Repo | #1008371 // findDollarValue

JavaX fragment (include)

1  
sbool findDollarValue_debug;
2  
3  
static Double findDollarValue(S s) {
4  
  if (s == null) null;
5  
  s = s.replace("$", "$ ");
6  
  L<S> tok = javaTok(s);
7  
  if (findDollarValue_debug) printStruct("fdv: " + tok);
8  
  int i = jfind(tok, "$<int>.<int>");
9  
  if (i >= 0) ret parseDouble(tok.get(i+2) + "." + tok.get(i+6));
10  
  i = jfind(tok, "$<int>");
11  
  if (i >= 0) ret parseDouble(tok.get(i+2));
12  
  null;
13  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1008371
Snippet name: findDollarValue
Eternal ID of this version: #1008371/4
Text MD5: 922a0615fbf525183194f7290562083e
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-05-09 23:35:57
Source code size: 398 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 368 / 415
Version history: 3 change(s)
Referenced in: [show references]