Spaces:
Configuration error
Configuration error
Download frontend/src/utils/amount-is-valid.ts from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 325 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/utils/amount-is-valid.ts
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/utils/amount-is-valid.ts
-
curl -L -o amount-is-valid.ts https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/utils/amount-is-valid.ts
325 Bytes
| const MINIMUM_AMOUNT = 10; | |
| const MAXIMUM_AMOUNT = 25_000; | |
| export const amountIsValid = (amount: string) => { | |
| const float = parseFloat(amount); | |
| if (Number.isNaN(float)) return false; | |
| if (float < 0) return false; | |
| if (float < MINIMUM_AMOUNT) return false; | |
| if (float > MAXIMUM_AMOUNT) return false; | |
| return true; | |
| }; | |