News for hackers. Stuff that matters.
Re:NoJS – Creating a calculator with only HTML and CSS by OJFord on Friday January 21, 2022 @09:23AM (#30023847)
Nice write-up, shame there's not a demo embedded (but understandable, bet that would be a hassle to work out on our blog too; too much for a one-off).

Also quite entertaining to click through to ScottLogic's home page after that, where the strapline for what they do is:

> Pragmatic solutions to complex software challenges

Re:NoJS – Creating a calculator with only HTML and CSS by tgv on Friday January 21, 2022 @09:31AM (#30023952)
There's a link to the calculator in the first paragraph.
Re:NoJS – Creating a calculator with only HTML and CSS by Israduscias on Friday January 21, 2022 @10:02AM (#30024399)
sadly, it has rounding errors if you multiply by 0.xxx
Re:NoJS – Creating a calculator with only HTML and CSS by Garora on Friday January 21, 2022 @02:05PM (#30028388)
Hi,

Please could you give me the exact input, wrong answer and also browser?

Thank you:)

Re:NoJS – Creating a calculator with only HTML and CSS by nomel on Friday January 21, 2022 @02:29PM (#30028749)
In Safari 15.2, everything is rounded down. 1/2 = 0, 8/9 = 0.

Also, it's not possible to type decimal numbers and have them displayed, although it appears they are actually being used internally. Initially, the "." button is disabled. If you press 0, then the "." button is enabled, disappears when clicked (good up to here), but then clicking any of the numbers don't change the display. So, typing "0.9 + 0.9" will look like "0 + 0" and will equal 1 (which is 1.8, rounded down). Also, if you click enough numbers, the numbers are disabled (as usual). So, the displayed state isn't matching the internal state, it appears.

Re:NoJS – Creating a calculator with only HTML and CSS by Garora on Friday January 21, 2022 @05:48PM (#30030960)
Ah yes, safari.

I should be able to fix the rounding errors. I should disable the decimals completely in safari as my method of getting decimals isnt supported yet. (@property).

Thank you so much for the feedback

Re:NoJS – Creating a calculator with only HTML and CSS by s_gourichon on Friday January 21, 2022 @10:55AM (#30025255)
? It doesn’t even allow non-integer numbers.
Re:NoJS – Creating a calculator with only HTML and CSS by btdmaster on Friday January 21, 2022 @11:05AM (#30025405)
It does not work in Firefox: https://github.com/QuarkNerd/noJS. It's not clear why though.
Re:NoJS – Creating a calculator with only HTML and CSS by Garora on Friday January 21, 2022 @12:55PM (#30027239)
Firefox doesnt support @property Which is what I'm using to round down and calculate the decimals
Re:NoJS – Creating a calculator with only HTML and CSS by cldellow on Friday January 21, 2022 @11:44AM (#30026050)
It does, but you have to enter a digit first (0 is fine) in order to see the decimal point button.
Re:NoJS – Creating a calculator with only HTML and CSS by OJFord on Friday January 21, 2022 @10:50AM (#30025184)
Ah so there is, thanks! I suppose at the time I wasn't so interested (I have a calculator) but by the end of the post I wanted to see it all come together, and unless I missed that too there isn't a link there.