Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem updating a number value on my companion settings screen

ANSWERED

On my companions setting screen the user can enter float values and this is working fine. The values get saved and I can reference them with no issues. The problem is if I try to update the value by something like: settingsStorage.setItem(key, 12.34);  the value will not be displayed on the settings screen. I tried converting the value to a string like: settingsStorage.setItem(key, String(12.34)) and settingsStorage.setItem(key, (12.34).toString()) and neither option worked. I must be doing something wrong. any ideas?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

You could try something like:

settingsStorage.setItem(key, JSON.stringify({'name':'12.34'}))
Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
0 Votes
2 REPLIES 2

You could try something like:

settingsStorage.setItem(key, JSON.stringify({'name':'12.34'}))
Peter McLennan
Gondwana Software
Best Answer
0 Votes

That appears to work, thank you.

Best Answer