Skip to content

Commit

Permalink
Remove leading zeros from price input while allowing decimal values
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamkmr04 committed Jun 20, 2024
1 parent b90ebc4 commit 954e075
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion views/POS/ProductDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ export default class ProductDetails extends React.Component<
value === null ||
isNaN(parseFloat(value))
) {
value = '';
value = '0';
} else {
value = value.replace(/^0+(?=\d)/, '');
}
value = value;
break;
Expand Down

0 comments on commit 954e075

Please sign in to comment.