mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-05 14:27:45 +02:00
refactor
This commit is contained in:
@@ -4,7 +4,7 @@ use <../split_str.scad>;
|
|||||||
function _str_to_int(t) = ord(t) - 48;
|
function _str_to_int(t) = ord(t) - 48;
|
||||||
|
|
||||||
function _parse_positive_int(t, value = 0, i = 0) =
|
function _parse_positive_int(t, value = 0, i = 0) =
|
||||||
i == len(t) ? value : _parse_positive_int(t, value * pow(10, i) + _str_to_int(t[i]), i + 1);
|
i == len(t) ? value : _parse_positive_int(t, value * 10 ^ i + _str_to_int(t[i]), i + 1);
|
||||||
|
|
||||||
function _parse_positive_number(t) =
|
function _parse_positive_number(t) =
|
||||||
len(search(".", t)) == 0 ? _parse_positive_int(t) :
|
len(search(".", t)) == 0 ? _parse_positive_int(t) :
|
||||||
|
Reference in New Issue
Block a user