Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
fix: Ts Error
Browse files Browse the repository at this point in the history
  • Loading branch information
wangkailang committed Feb 10, 2020
1 parent 574c4b4 commit 95c4955
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/UsageBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const UsageBar: React.FC<UsageBarProps> = props => {
if (!hasPercent && now) {
const nowArr = bulk(now, { splitUnit: true });
nowValue = nowArr[0];
nowSuffix = nowArr[1];
nowSuffix = nowArr[1] as string;
}
const maxArr: any = max && bulk(max, { splitUnit: true });
maxValue = maxArr[0];
Expand Down
2 changes: 1 addition & 1 deletion src/utils/bulk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function bulk(value: number, options: OPTIONS, locale?: LocaleTyp
i++;
}
unit = BULK[i - 1][1];
let resultValue: number = value / BULK[i - 1][0];
let resultValue: any = value / (BULK[i - 1][0] as number);
if (parseInt(String(resultValue), 10) !== resultValue) {
resultValue = Number(resultValue.toFixed(2));
}
Expand Down

0 comments on commit 95c4955

Please sign in to comment.