Yashotantra Academy
AI · Blockchain · Cloud · Data
Dark mode active
Learn
Tracks
ABCD
Certification
More
▾
Dark mode active
Learn
Tracks
ABCD
Certification
Study
Theory
Code Lab
Build
Solidity IDE
Staking Sandbox
Simulation
Reference
Wallets
Gas Fees
Explorers
← Code Lab
React Native
0/50 solved · 0%
All lessons
lesson
code
Forms · easy
7. Sanitizing decimal input
Clean TextInput text for a numeric field.
Write `sanitizeDecimal(text)` that strips all characters except digits and a single leading `.`. Multiple dots collapse to the first one.
Required in your answer:
replace(
Reveal solution
Run & check
Reset
Transpiled, then run in a sandbox
function sanitizeDecimal(text) { // TODO }
Output appears here.
← 6. Modeling useState updates
8. Resolving image sources →