Home > Software design >  convert from string to integer of apiLink value in Javascript
convert from string to integer of apiLink value in Javascript

Time:01-03

i have an apiLink for pdf open.

i want to convert companyValue and empValue into integer format.

`https://mobileapi.unq.co.il/api/TlushSachar/GetPrintTlushMisradHinuch?company=${companyValue}&year_month=${yearMonthValue}&employee=${empValue}`)

How can i convert those two value from string to integer?

CodePudding user response:

Try it:

`https://mobileapi.unq.co.il/api/TlushSachar/GetPrintTlushMisradHinuch?company=${parseInt(companyValue)}&year_month=${yearMonthValue}&employee=${parseInt(empValue)}`)

You can see: https://www.w3schools.com/js/js_number_methods.asp

CodePudding user response:

you can use parseInt() Method for reference see this

CodePudding user response:

use the following method to convert the string to a number

Number(companyValue)
Number(empValue)
  • Related