Skip to content

Commit

Permalink
fixed_decimal: clarify documentation for position sign in padding fun…
Browse files Browse the repository at this point in the history
…ctions (#5243)

Example:
`pad_start` documentation states that "Negative numbers have no effect".
This is ambiguous between the number being formatted and the position
number passed as an argument.

Resolve this and other similar instances. Example: "Negative position
numbers have no effect"
  • Loading branch information
kartva authored Aug 13, 2024
1 parent f61a5a0 commit d801430
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utils/fixed_decimal/src/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ impl FixedDecimal {

/// Returns this number padded with leading zeros on a particular position.
///
/// Negative numbers have no effect.
/// Negative position numbers have no effect.
///
/// Also see [`FixedDecimal::with_max_position()`].
///
Expand All @@ -1050,7 +1050,7 @@ impl FixedDecimal {

/// Pads this number with leading zeros on a particular position.
///
/// Negative numbers have no effect.
/// Negative position numbers have no effect.
///
/// Also see [`FixedDecimal::set_max_position()`].
///
Expand Down Expand Up @@ -1091,7 +1091,7 @@ impl FixedDecimal {
/// Returns this number padded with trailing zeros on a particular (negative) position.
/// Will truncate zeros if necessary, but will not truncate other digits.
///
/// Positive numbers have no effect.
/// Positive position numbers have no effect.
///
/// Also see [`FixedDecimal::trunced()`].
///
Expand Down Expand Up @@ -1120,7 +1120,7 @@ impl FixedDecimal {
/// Pads this number with trailing zeros on a particular (non-positive) position. Will truncate
/// trailing zeros if necessary, but will not truncate other digits.
///
/// Positive numbers have no effect.
/// Positive position numbers have no effect.
///
/// Also see [`FixedDecimal::trunc()`].
///
Expand Down

0 comments on commit d801430

Please sign in to comment.