This post is from a low-reputation account and contains an unverified outbound link. Be cautious before clicking external links.

Large Soda Prices In BTC - Pointless Development :D

Words
190
Reading
1 min
9y
Listen to this post
~1 min

Sketch.png

here is the pen with all the code
https://codepen.io/maxcream/full/rJyGgo/

Listing Large Soda Prices From Maccers & KFC

Using HTML, CSS and Javascript

Made a simple web page that tells you the price of a maccers or kfc large soda in bitcoin value. Just as Big SMOKE would have wanted.

latest.jpg

Golden Nugget

I found that "," (a comma) in a number string will stop it being converted to a Number type within Javascript.

Troubleshooting and Solution

Suprisingly it took me a while to figure out it was a comma in the string that wasn't allowing me to convert a string into a number via the parseFloat() method.

Turns out it must be an illegal character and it doesn't just ignore them like i assumed it would. So to sum up i just replaced the "," in the string with the .replace(",", "") method to replace the comma in the string with nothing, in other words deleting it. Then i was able to convert into a number to do some QUICKMATHS.

hqdefault.jpg

check out the codepen link if you want to see it in more detail or edit it yourself...

Large Soda Prices In BTC - Pointless Development :D | Ecency