File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ String camelCase2UnderScoreCase(String name) {
82
82
});
83
83
}
84
84
85
+ /// use the string replace's method the resolve the int and double problem.
85
86
String convertJsonString (String jsonString) {
86
87
var numberReg = RegExp (r"[0-9]\.[0-9]+" );
87
88
@@ -93,16 +94,7 @@ String convertJsonString(String jsonString) {
93
94
var m = allMatch[i];
94
95
var s = m.group (0 );
95
96
96
- // if (double.tryParse(s) is double) {
97
- // // 说明是真实的小数
98
- // // 这里直接匹配下一个
99
- // print("$s is double");
100
- // continue;
101
- // }
102
-
103
- // print("$s is int");
104
-
105
- // 应该是double,但由于js的原因被识别成了整数数,这里对这种数据进行处理,将这里的最后一位从0替换为1
97
+ // 应该是double,但由于js的原因被识别成了整数数,这里对这种数据进行处理,将这里的最后一位从0替换为5,以便于让该被js识别成小数 而非数字
106
98
s = s.replaceRange (s.length - 1 , s.length, "5" );
107
99
jsonString = jsonString.replaceRange (m.start, m.end, s);
108
100
}
You can’t perform that action at this time.
0 commit comments