Skip to content

Commit

Permalink
fix yarn clean-test
Browse files Browse the repository at this point in the history
Reviewed By: kayhadrin

Differential Revision: D43328764

fbshipit-source-id: b5ab4b3c1fd27fe71474740109a10cb6edbf9359
  • Loading branch information
luluonet authored and facebook-github-bot committed Feb 16, 2023
1 parent 11919a0 commit 10a162b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions runtime/shared/intlNumUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,7 @@ function formatNumberWithLimitedSigFig(
function _roundNumber(valueParam: number, decimalsParam?: number): string {
const decimals = decimalsParam == null ? 0 : decimalsParam;
const pow = Math.pow(10, decimals);
let value: number | string = valueParam;
// $FlowFixMe[unsafe-arithmetic]
value = Math.round(value * pow) / pow;
value += '';
let value = (Math.round(valueParam * pow) / pow).toString();
if (!decimals) {
return value;
}
Expand All @@ -293,7 +290,7 @@ function _roundNumber(valueParam: number, decimalsParam?: number): string {

const pos = value.indexOf('.');
let zeros = 0;
if (pos == -1) {
if (pos === -1) {
value += '.';
zeros = decimals;
} else {
Expand All @@ -302,7 +299,6 @@ function _roundNumber(valueParam: number, decimalsParam?: number): string {
for (let i = 0, l = zeros; i < l; i++) {
value += '0';
}
// $FlowFixMe[incompatible-return]
return value;
}

Expand Down

0 comments on commit 10a162b

Please sign in to comment.