mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:36:00 +02:00
Rename into decimal
to into float
(#9979)
# Description We keep "into decimal" for a release and warn through a message that it will be removed in 0.86. All tests are updated to use `into float` # User-Facing Changes `into decimal` raises a deprecation warning, will be removed soon. Use `into float` as the new functionally identical command instead. ``` ~/nushell> 2 | into decimal Error: × Deprecated command ╭─[entry #1:1:1] 1 │ 2 | into decimal · ──────┬───── · ╰── `into decimal` is deprecated and will be removed in 0.86. ╰──── help: Use `into float` instead 2 ``` # Tests + Formatting Updated --------- Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
6e9b6f22c9
commit
1fb4f9e455
@ -2426,7 +2426,7 @@ impl Value {
|
||||
if let Some(val) = lhs.checked_add(*rhs) {
|
||||
Ok(Value::int(val, span))
|
||||
} else {
|
||||
Err(ShellError::OperatorOverflow { msg: "add operation overflowed".into(), span, help: "Consider using floating point values for increased range by promoting operand with 'into decimal'. Note: float has reduced precision!".into() })
|
||||
Err(ShellError::OperatorOverflow { msg: "add operation overflowed".into(), span, help: "Consider using floating point values for increased range by promoting operand with 'into float'. Note: float has reduced precision!".into() })
|
||||
}
|
||||
}
|
||||
(Value::Int { val: lhs, .. }, Value::Float { val: rhs, .. }) => {
|
||||
@ -2532,7 +2532,7 @@ impl Value {
|
||||
if let Some(val) = lhs.checked_sub(*rhs) {
|
||||
Ok(Value::int(val, span))
|
||||
} else {
|
||||
Err(ShellError::OperatorOverflow { msg: "subtraction operation overflowed".into(), span, help: "Consider using floating point values for increased range by promoting operand with 'into decimal'. Note: float has reduced precision!".into() })
|
||||
Err(ShellError::OperatorOverflow { msg: "subtraction operation overflowed".into(), span, help: "Consider using floating point values for increased range by promoting operand with 'into float'. Note: float has reduced precision!".into() })
|
||||
}
|
||||
}
|
||||
(Value::Int { val: lhs, .. }, Value::Float { val: rhs, .. }) => {
|
||||
@ -2610,7 +2610,7 @@ impl Value {
|
||||
if let Some(val) = lhs.checked_mul(*rhs) {
|
||||
Ok(Value::int(val, span))
|
||||
} else {
|
||||
Err(ShellError::OperatorOverflow { msg: "multiply operation overflowed".into(), span, help: "Consider using floating point values for increased range by promoting operand with 'into decimal'. Note: float has reduced precision!".into() })
|
||||
Err(ShellError::OperatorOverflow { msg: "multiply operation overflowed".into(), span, help: "Consider using floating point values for increased range by promoting operand with 'into float'. Note: float has reduced precision!".into() })
|
||||
}
|
||||
}
|
||||
(Value::Int { val: lhs, .. }, Value::Float { val: rhs, .. }) => {
|
||||
@ -3547,7 +3547,7 @@ impl Value {
|
||||
if let Some(val) = lhs.checked_pow(*rhs as u32) {
|
||||
Ok(Value::int(val, span))
|
||||
} else {
|
||||
Err(ShellError::OperatorOverflow { msg: "pow operation overflowed".into(), span, help: "Consider using floating point values for increased range by promoting operand with 'into decimal'. Note: float has reduced precision!".into() })
|
||||
Err(ShellError::OperatorOverflow { msg: "pow operation overflowed".into(), span, help: "Consider using floating point values for increased range by promoting operand with 'into float'. Note: float has reduced precision!".into() })
|
||||
}
|
||||
}
|
||||
(Value::Int { val: lhs, .. }, Value::Float { val: rhs, .. }) => {
|
||||
|
Reference in New Issue
Block a user