3 ms·
Love this, but the lack of interpretation of prefixed currency symbols is absolutely maddening! That it simply ignores the number and operand with no indication
by gorkish 6y ago
Love this, but the lack of interpretation of prefixed currency symbols is absolutely maddening! That it simply ignores the number and operand with no indication that these elements are ignored could easily lead to problems. I don't think I could in good conscience trust myself or those I might consider to be the target audience of this app to notice parsing errors in every case. Consider:
"$400 / 20" => 20 (ERROR)
"$400 / 25" => 25 (ERROR)
"400$ / 20" => 20 $ (OK)
"400$ / 25" => 16 $ (OK)
- vageli 6y agoYour comment made me realize that most unit notation I'm familiar with has the unit as a suffix, with currency being the only standout that comes to mind.
- roywiggins 6y agoIt depends on the currency / country, too. Lots of countries put the currency afterwards, even "¢" comes after. $ and £ come before, but € ends up moving depending on the language. https://en.wikipedia.org/wiki/Language_and_the_euro#Written_conventions_for_the_euro_in_the_languages_of_EU_member_states https://en.wikipedia.org/wiki/Language_and_the_euro#Written_...
- deleted 6y ago[deleted]
- gorkish 6y agoBinary, ocatal and hexidecimal literals often are indicated with prefixes: 0b, 0 and 0x respectively. There are probably other esoteric cases that I can't think of off the top of my head. "Qty" is often prefixed, for instance. It's a complicated problem for a natural language calculator, to be sure. Here are a couple examples of ways to represent four thousand Canadian dollars that you might encounter and have no trouble interpreting as a human. This could be a good target for an ML tokenizer... -$4000CAD CA$-4,000.00 4.000,00CAD$
- bbodi 6y agoIn your case syntax highlighting helps. Everything which is not part of a calculation is rendered as a simple text (greyish): [image](https://trello-attachments.s3.amazonaws.com/558a94779b3b3c5d89efeaa6/5fe0ae9f0b9791732fdf6901/d5b82722d364fc733850d1ef73ad4059/brave_TEMMNAnVJl.png https://trello-attachments.s3.amazonaws.com/558a94779b3b3c5d...) But yes I admit it takes some time to get used to the colors and their meanings. Currencies and exchange between them are on my feature list btw.
- gorkish 6y agoAwesome; this is great to hear. An idea you might consider is to display some kind of warning symbol or message if the input contains digits or operands which are not interpreted as part of the calculation that produces the output. This would have made the semantic meaning of the syntax highlighting immediately more evident.
- jannes 6y agoIt would also be nice to support other currency symbols. In Europe there are € and £, for example. https://en.wikipedia.org/wiki/List_of_currencies_in_Europe https://en.wikipedia.org/wiki/List_of_currencies_in_Europe