-
|
Is language/locale supported? If yes, how can I set it. I want to use the comma (",") as decimal separator due to my keyboard layout is Brazilian portuguese (it have a comma instead a dot on numeric keyboard). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hello @bjnobre , While I am very sympathetic to the use of the decimal comma, there is a significant barrier to doing so in calc. Calc is a C-style arbitrary precision calculator. As with C, the calc language uses the comma "," as a fundamental operator. Consider the following function call: Consider what would happen if that 2.7 were written with the decimal comma: This is because the round function takes optional arguments, separated by comma ",";s, Moreover consider how awkward it would be if the decimal comma were enabled and Consider: Say somehow the harder were to understand that the 2nd comma separated the next argument, unfortunately existing code would break: This is because the round function can take a 3rd optional argument (rounding mode). Even worse, consider the declaration is a matrix: Consider what would happen if the 2,3 were written with the decimal comma: Much worse, declaring variables would break. This is valid calc: However if a were initialized with a decimal comma: one generates a "Constant before comma operator" warning. I could go on and on, but I think you get the point / comma. 🤓 I don't see an easy way to allow decimal comma's a part of the calc input syntax language. I wish there was a straightforward way to allow for decimal comma's in calc, but unfortunately:
In addition, whitespace is a token separator, so: is interpreted as the We are unable to change the calc syntax because, like in int x = 1 000;Sorry |
Beta Was this translation helpful? Give feedback.
Hello @bjnobre ,
While I am very sympathetic to the use of the decimal comma, there is a significant barrier to doing so in calc.
Calc is a C-style arbitrary precision calculator. As with C, the calc language uses the comma "," as a fundamental operator.
Consider the following function call:
Consider what would happen if that 2.7 were written with the decimal comma:
This is because the round function takes optional arguments, separated by comma ",";s,
In this case 7 becomes number of places to round.
Moreover consider how awkward it would be if the decimal comma were enabled and
one wanted to round …