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

169
Views
Cómo cargar un dígito con 000 en el script de Google

tengo este codigo:

 var userProperties = PropertiesService.getUserProperties(); var units1 = userProperties.getProperty('name'); if (units1 = null){ var userProperties = PropertiesService.getUserProperties(); userProperties.setProperty('name', '000'); } var userProperties = PropertiesService.getUserProperties(); userProperties.setProperty('name', units1 + 1); var userProperties = PropertiesService.getUserProperties(); var units = userProperties.getProperty('name');

El problema es que no suma 000 - 0.01 - 0.02. Solo suma 000 - 0.1 - 0.2.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puedes simplificar tu script en este:

Guion:

 function myFunction() { var userProperties = PropertiesService.getUserProperties(); // since getProperty always returns string, parse it into float // if not instantiated, assign '000' var units1 = parseFloat(userProperties.getProperty('name')) || '000'; Logger.log(units1) // add parseFloat in case units1 is still '000' userProperties.setProperty('name', parseFloat(units1) + 0.01) var units = userProperties.getProperty('name'); Logger.log(units) }

1ra carrera:

1º

2da carrera:

2do

Esto debería incrementar cada ejecución en 0.01 .

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!