QCAD Bugtracker

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category QCAD (main)
  • Assigned To
    Andrew
  • Operating System Windows XP
  • Severity Low
  • Priority Very Low
  • Reported Version 3.12.6
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: QCAD Bugtracker
Opened by Husky - 10.02.2016
Last edited by Andrew - 11.02.2016

FS#1378 - Wrong value separator accepted and accomplished

My settings for Coordinate Format: Decimal Point = Dot

Accidentally using a comma instead of a dot in a value field leads to a wrong result without any warning.

Test:

Using the “Rectangle with Size” tool accidentally with a comma will not trigger a warning (red text) and it will draw a wrong sized rectangle.
It seems to me that QCAD is using the after comma value to draw this rectangle.
Given value 30,5 by 50,7 leads to a rectangle 5 by 7
Crazy values like 1.,.35 by 71.,.75 are also accepted and leads to a rectangle size of 35 by 75 without any warning.
A crazy value like 71.,..75 will finally trigger a red text warning!

Counter test horiz. Line: Value 100,25 leads to a line with 25 in length.
Value 100.25 leads to a line with 100.25 in length.

Using the same tools with the correct separator will work as expected!

Same game with most of all other tools which are asking for a given value. No warning at all - just wrongly accomplished.

Closed by  Andrew
11.02.2016 07:40
Reason for closing:  Not a bug
Husky commented on 10.02.2016 08:29
Admin
Andrew commented on 10.02.2016 08:31

Please note that all input fields which expect a numerical value actually accept any valid JavaScript expression.

These are all valid JavaScript expressions:

30,5      // list of two values: 30 and 5
1.,.35    // list of two values: 1.0 and 0.35

Evaluating a list of multiple values in JavaScript returns the last value, so this behavior is technically correct, although I understand it might not appear very meaningful.
I'd generally strongly recommend to not use comma as decimal separator as QCAD has to perform some additional acrobatics to make this work with JavaScript which uses commas to separate items in a list of arguments.

It would be possible to trigger a warning when lists of values are entered. However, this would also break more advanced JavaScript input such as Math.pow(2.5,3) for 2.5 to the power of 3.

Husky commented on 10.02.2016 19:15

Till now I was just under the impression that I only but a length or a diameter in and not a JavaScript expression. Ok, my fault - as always - thanks for explanation!

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing