Merge 85df6dc77d
into ca8eb856e8
This commit is contained in:
commit
eae1825688
|
@ -90,6 +90,10 @@ fn action(input: &Value, _args: &CellPathOnlyArgs, head: Span) -> Value {
|
||||||
Value::String { val: s, .. } => {
|
Value::String { val: s, .. } => {
|
||||||
let other = s.trim();
|
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>() {
|
match other.parse::<f64>() {
|
||||||
Ok(x) => Value::float(x, head),
|
Ok(x) => Value::float(x, head),
|
||||||
Err(reason) => Value::error(
|
Err(reason) => Value::error(
|
||||||
|
|
|
@ -279,7 +279,11 @@ fn action(input: &Value, args: &Arguments, span: Span) -> Value {
|
||||||
),
|
),
|
||||||
Value::String { val, .. } => {
|
Value::String { val, .. } => {
|
||||||
if radix == 10 {
|
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),
|
Ok(val) => Value::int(val, span),
|
||||||
Err(error) => Value::error(error, span),
|
Err(error) => Value::error(error, span),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user