I am having trouble to convert a string 'u12345678910' to an integer without scientific notation. So basically, it literally needs to be exactly 12345678910.
How I have approached it:
1. slice the 'u' to get the number i want (after slice its still a string) OR use .replace()
2. tried parseInt(), Number(), both give me a number in scientific notation.
3. parseFloat() & then parseInt(), don't know why but read somewhere that this might work, it didn't.
Why do i need this exact number?
Since it is a chartId of an EmbeddedChart & Google Slides API is giving me the error that the ID needs to be of TYPE_INT32.
Hopefully someone has a solution to this, since its the only thing blocking my project at the moment :(
Please find below some sample code of how to reproduce.
*I am working in Google Apps Script, Chart is in Spreadsheet & I am using the Google Slides API library of Spencer Easton
var ss = SpreadsheetApp.getActiveSpreadsheet(),
allSheets = ss.getSheets();
var chart = allSheets[0].getCharts()[0],
chartId = chart.getId(); // this returns 'u12345678910'
var chartStringNumber = chartId.slice(1); // returns 12345678910 (string)
var chartIdNumber = Number(chartStringNumber); // Here I want the result to be typeof INT & 12345678910, but i keep getting a number incl scientific notation. I have also tried parseInt().