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

142
Views
Cuando trato de usar valores flotantes dentro de un campo de texto en React, el punto o la coma se eliminan

Tengo una tabla con algunos campos de texto y valores. Los valores ya están dados. Todos son números enteros y estoy tratando de cambiar uno de ellos a un flotante usando punto o coma, pero cuando uso la coma o el punto, se eliminan.

 const DEFAULT_CHARGING_CURVE = [ { SoC: 44, power: 250 }, { SoC: 48, power: 240 }, { SoC: 51, power: 220 }, { SoC: 54, power: 200 }, { SoC: 57, power: 180 }, { SoC: 61, power: 170 }, { SoC: 65, power: 160 }, { SoC: 69, power: 155 }, { SoC: 70, power: 145 }, { SoC: 76, power: 115 }, { SoC: 80, power: 80 }, { SoC: 89, power: 60 }, { SoC: 90, power: 55 }, { SoC: 100, power: 0 }, ]; const [chargingCurveTableData, setChargingCurveTableData] = useState( DEFAULT_CHARGING_CURVE,

);

 <TableCell className={classes.tableCell}> <TextField inputProps={{ 'aria-label': `chargingCurveTable Row ${i}, power`, style: { textAlign: 'center' }, }} type='number' value={row.power} onChange={(event) => updateChargingCurveTableRowPower( i, event.target.value, ) } ></TextField> </TableCell>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

agregue al valor de paso de inputProps para mayor precisión

ejemplo:

 const TestComponent = () => { const [value, setValue] = useState(0) return ( <TextField inputProps={{ step: 0.1, }} variant="standard" label="test" value={value} type="number" onChange={(e) => { setValue(e.target.value) }} /> ) }

Tengo esta versión "@mui/material": "^5.8.4"

about 4 years ago · Juan Pablo Isaza 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!