Skip to content

Commit

Permalink
refactor(mobile): correctly type prepareValue util
Browse files Browse the repository at this point in the history
  • Loading branch information
weronikaolejniczak committed May 27, 2024
1 parent ecee98c commit fe0d804
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/mobile/src/helpers/prepareValue.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const prepareValue = (value) => {
const prepareValue = (value: string) => {
value = value.replace(/ /g, '');
value = parseFloat(value).toFixed(2);
value = parseFloat(value);
const number = parseFloat(value);

if (isNaN(value)) {
if (isNaN(number)) {
return 0;
} else {
return value;
return number;
}
};

Expand Down

0 comments on commit fe0d804

Please sign in to comment.