mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
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:
committed by
GitHub
parent
bf82417d52
commit
349e83abd0
@ -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 {
|
||||
|
Reference in New Issue
Block a user