LuisMa Suárez Gutiérrez
Posts: 0
Joined: Mon Aug 18, 2014 9:12 pm

i cant retrieve a value from local Storage and perform arithmetic on it. it comes up as NaN

I'm sending several values to Local storage via "set storage variable" action using "bind to component" to a label's text element.

but then i try to retrieve from local storage and i cant because it cant parseInt().

when i look at the debug tools, i see something like " "0" " when the variable is a number, but if it is text, it doesnt have qoutation marks.

why?
Image

in the image below, when i click the checkmark ( black ink) i send the number of available invitations ( blue ink) and the number of used invitations (red ink) to local storage.

immediately after i try something similar to

var invitations=parseInt( localStorage.getItem('invitations_lsv') );

var used=parseInt( localStorage.getItem('used_lsv') );

if ( invitations used ) then used++; //this is a check-in

i can never compare as i always get a NaN

why??

Image

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

i cant retrieve a value from local Storage and perform arithmetic on it. it comes up as NaN

Hi -

[quote:]
I'm sending several values to Local storage via "set storage variable" action using "bind to component" to a label's text element.
[/quote]

Could you please show how exactly you make this in builder and with what components?

Return to “Issues”