Accordng to those links that I have posted before
https://linguaholic.com/linguablog/doll ... er-number/
https://grammarhow.com/euro-symbol-befo ... er-number/
it is a general convention in the english language to write the currency before the amount. And since (as a matter of convention) we use the english language, we might as well follow this currency convention. I can only guess that the slider mousewheel functionality not working has to do with the fact that inside the function
nameSum
two variables are defined by a string that contains a currency symbol. Since the .replace expects to keep everything after a character: totalSum = Number(document.querySelector("#total").innerHTML.replace(/.*\: ./, ''));
var sum = Number(document.querySelector("#placedBet").innerHTML.replace(/./, ''));
(replace the first character
(/./)
, the one that is expected a currency symbol, with nothing ('')
). The replace should get rid of the LAST character (since you prefer the currency symbol at the end, that means that the lasta character is the currency symbol.
Try
replace(/.$/, ''))
It should do just that.At some point, why not go big: Prepare multi-language dialogs. There the position of the currency symbol will be what is usual in that language.
Well there are some ready-made solutions for checkboxes, for instance:
https://www.w3docs.com/snippets/css/how ... h-css.html
I haven't implement them because I had bigger fish to fry, I might do it and be done with this.
css is not my cup of tea either, but since we are here, might as well face the music and dance !:lol:
I take full responsibity of the bad coding practices. My inexperience in programming, my total inexperience with js (wrote Hello world last year, nearly never touched it again since) and the need to implement things in a "proof of concept" level led to dirty code.Drugwash wrote: ⤴Tue Nov 22, 2022 10:30 am Maybe a review of the features would be in order just to make sure there won't be any further overhaul involved later on.
Also the code structure may need some tweaking, for example certain frequently used variables (i.e.sum
,totalSum
) should be made global in order to avoid requesting them repeatedly in multiple functions.
However, I guess that moving to Python will solve many issues, and create others. We will see...