Style adjustments to decimal input

main
Ashelyn Dawn 5 years ago
parent 2edde20c6d
commit aa8562a1a1

@ -68,12 +68,13 @@ export default function Input({label, prefix, numDecimals, error, hint, name, va
} }
const filledText = ((prefix + ' ') || '') const filledText = ((prefix + ' ') || '')
+ (Math.floor(currentValue) || '0') + (currentValue !== 0 ? Math.floor(currentValue) : '')
+ (currentDecimals >= 0 ? '.' : '') + (currentDecimals >= 0 ? '.' : '')
+ (currentDecimals > 0 ? currentValue.toFixed(currentDecimals).split('.')[1] : '') + (currentDecimals > 0 ? currentValue.toFixed(currentDecimals).split('.')[1] : '')
const remainingText = const remainingText =
(currentDecimals < 0 ? '.' : '') (currentValue === 0 ? '0' : '')
+ (currentDecimals < 0 ? '.' : '')
+ (numDecimals !== undefined && currentDecimals < numDecimals ? '0'.repeat(numDecimals - Math.max(currentDecimals, 0)) : '') + (numDecimals !== undefined && currentDecimals < numDecimals ? '0'.repeat(numDecimals - Math.max(currentDecimals, 0)) : '')
return ( return (

@ -69,6 +69,7 @@
} }
.inputDecorators > span { .inputDecorators > span {
white-space: pre;
display: inline-block; display: inline-block;
font: 400 13.3333px Arial; font: 400 13.3333px Arial;
} }

Loading…
Cancel
Save