This commit is contained in:
Sophia June Turner 2024-08-02 08:42:25 -05:00 committed by GitHub
commit eae1825688
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -90,6 +90,10 @@ fn action(input: &Value, _args: &CellPathOnlyArgs, head: Span) -> Value {
Value::String { val: s, .. } => {
let other = s.trim();
// NOTE: this assumes US style commas in values
// and needs to be updated to respect locale
let other = other.replace(',', "");
match other.parse::<f64>() {
Ok(x) => Value::float(x, head),
Err(reason) => Value::error(

View File

@ -279,7 +279,11 @@ fn action(input: &Value, args: &Arguments, span: Span) -> Value {
),
Value::String { val, .. } => {
if radix == 10 {
match int_from_string(val, span) {
// NOTE: this assumes US style commas in values
// and needs to be updated to respect locale
let val = val.replace(',', "");
match int_from_string(&val, span) {
Ok(val) => Value::int(val, span),
Err(error) => Value::error(error, span),
}