Port str to-decimal to into decimal command. (#408)

* Port str to-decimal to into decimal command. Add also a Value::test_float function for tests only

* Add support for handling integers into decimals and fix issues with error span
This commit is contained in:
onthebridgetonowhere
2021-12-03 03:01:19 +01:00
committed by GitHub
parent bf82417d52
commit 349e83abd0
4 changed files with 177 additions and 0 deletions

View File

@ -631,6 +631,14 @@ impl Value {
span: Span::unknown(),
}
}
// Only use these for test data. Span::unknown() should not be used in user data
pub fn test_float(val: f64) -> Value {
Value::Float {
val,
span: Span::unknown(),
}
}
}
impl Default for Value {