Skip to content

Commit

Permalink
Merge pull request #41503 from GandalfGwaihir/issue40946
Browse files Browse the repository at this point in the history
[Fix]: Inconsistency in saving values ending with decimal point in `distance rate`  and `IOU`
  • Loading branch information
lakchote authored May 3, 2024
2 parents a16880c + 30b67ad commit aa0eae0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/PolicyDistanceRatesUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function validateRateValue(values: FormOnyxValues<RateValueForm>, currency: stri
const decimalSeparator = toLocaleDigit('.');

// Allow one more decimal place for accuracy
const rateValueRegex = RegExp(String.raw`^-?\d{0,8}([${getPermittedDecimalSeparator(decimalSeparator)}]\d{1,${CurrencyUtils.getCurrencyDecimals(currency) + 1}})?$`, 'i');
const rateValueRegex = RegExp(String.raw`^-?\d{0,8}([${getPermittedDecimalSeparator(decimalSeparator)}]\d{0,${CurrencyUtils.getCurrencyDecimals(currency) + 1}})?$`, 'i');
if (!rateValueRegex.test(parsedRate) || parsedRate === '') {
errors.rate = 'workspace.reimburse.invalidRateError';
} else if (NumberUtils.parseFloatAnyLocale(parsedRate) <= 0) {
Expand Down

0 comments on commit aa0eae0

Please sign in to comment.