[html5] How to test for cents currency symbol in javascript

Larry Martell larry.martell at gmail.com
Sat May 24 05:19:05 PDT 2014


I need to test for the cents currency symbol in my JavaScript program.

I have a variable with this value:

¢40.36

In my program I do this:

ax = (a[0][0] == '¢');

When my program run ax is False. But from the console it evaluates to True:

>>> a[0]
"¢40.36"
>>> ax
false
>>> a[0][0] == '¢'
true
>>> ax = (a[0][0] == '¢')
true
>>> ax
true

Can anyone explain this odd inconsistency and tell me how I can test
for the cents character?


More information about the Help mailing list