Skip to content

Commit 103d92b

Browse files
committed
delete some print and update comment
1 parent 6f007e8 commit 103d92b

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

lib/generator.dart

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ String camelCase2UnderScoreCase(String name) {
8282
});
8383
}
8484

85+
/// use the string replace's method the resolve the int and double problem.
8586
String convertJsonString(String jsonString) {
8687
var numberReg = RegExp(r"[0-9]\.[0-9]+");
8788

@@ -93,16 +94,7 @@ String convertJsonString(String jsonString) {
9394
var m = allMatch[i];
9495
var s = m.group(0);
9596

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识别成小数 而非数字
10698
s = s.replaceRange(s.length - 1, s.length, "5");
10799
jsonString = jsonString.replaceRange(m.start, m.end, s);
108100
}

0 commit comments

Comments
 (0)