mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 06:55:36 +02:00
Add --to-float to str plugin (#1872)
This commit is contained in:
@ -172,6 +172,7 @@ pub fn expect_return_value_at(
|
||||
}
|
||||
|
||||
pub mod value {
|
||||
use bigdecimal::BigDecimal;
|
||||
use nu_errors::ShellError;
|
||||
use nu_protocol::{Primitive, TaggedDictBuilder, UntaggedValue, Value};
|
||||
use nu_source::Tag;
|
||||
@ -186,6 +187,10 @@ pub mod value {
|
||||
UntaggedValue::Primitive(Primitive::Int(i.into())).into_untagged_value()
|
||||
}
|
||||
|
||||
pub fn decimal(f: impl Into<BigDecimal>) -> Value {
|
||||
UntaggedValue::Primitive(Primitive::Decimal(f.into())).into_untagged_value()
|
||||
}
|
||||
|
||||
pub fn string(input: impl Into<String>) -> Value {
|
||||
UntaggedValue::string(input.into()).into_untagged_value()
|
||||
}
|
||||
|
Reference in New Issue
Block a user