Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
¿Por qué el valor de entrada muestra un tipo de cadena en lugar de un tipo de número?

Estoy tratando de obtener el tipo de número de valor de entrada. Pero el valor sigue mostrándome que es un tipo de cadena. ¿Cómo puedo solucionar esto?

 const [price, setPrice] = useState();

const handlePrice = (event) => {
 console.log(event.target.value);
 setPrice(event.target.value);
};

 <div className="col-md-6">
 <label for="inputPrice" className="form-label">
 Price
 </label>
 <input
 value={price}
 onChange={handlePrice}
 type="number"
 className="form-control"
 id="inputPrice"
 />
 </div>
 <div className="col-12">
almost 4 years ago · Santiago Trujillo
1 answers
Answer question

0

const handlePrice = (event) => {
 console.log(event.target.value);
 // setPrice(parseInt(event.target.value));
 // setPrice(event.target.value * 1);
 setPrice(Number(event.target.value));
};
almost 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!