Need to take a SELECT drop down list options and find if any of the values are whole numbers, then append a .00 to the list value option. need to change the value as well.
<select>
<option value="1">1</option>
<option value="1.99">1.99</option>
<option value="2.99">2.99</option>
<option value="4">4</option>
</select>
Thanks in advance for any help on this
Not quite sure if this is the best way, but it works:
Demo.
On second thought, you could also do this using
toFixed, which is cleaner:Demo.