Skip to content

Commit

Permalink
Remove trailing space from numericStepper when suffix doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
João Marcos Gris authored and emersonlaurentino committed Jun 2, 2020
1 parent f552529 commit 1c9b470
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Remove trailing space from `numericStepper` when there isn't a suffix

## [9.119.0] - 2020-05-21

Expand Down
3 changes: 2 additions & 1 deletion react/components/NumericStepper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ const validateValue = (value, min, max, defaultValue) => {
}

const formattedDisplayValue = (value, unitMultiplier, suffix) => {
const parsedSuffix = suffix ? ` ${suffix}` : suffix
return `${Math.round((value * unitMultiplier + Number.EPSILON) * 100) /
100} ${suffix ? suffix : ''}`
100}${parsedSuffix}`
}

const validateDisplayValue = (value, min, max, suffix, unitMultiplier) => {
Expand Down

1 comment on commit 1c9b470

@vercel
Copy link

@vercel vercel bot commented on 1c9b470 Jun 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.