Do
var tenant_id_count = parseInt(tenant_id_int, 10);
This is because the line starting with β0β is parsed as octal (which doesnβt work very well for β009β, therefore you get 0) if you did not specify a radius.
From MDN :
If the input line starts with "0", the radius is eight (octal). This function is non-standard, and some implementations do not knowingly support it (use radix 10 instead). For this reason, always specify the radius when using parseInt.
The most important thing to remember: Always indicate the radius .
Denys seguret
source share