Skip to content

Draw Polygon. Error parse dot in number. #204

Description

@qywx

2
This is because my localized separator is comma. All works normally with it. Since Altium supports both separators it should be cool to make script "eat" both too.

Activity

  1. qywx commented on Sep 20, 2015

    @qywx
    Author

    I have solved it with

    ...
    ' Line thickness
    ' check locale
    if( CStr(0.1) = "0,1" ) then
        EditLineThicknessMm.Text = (Replace(EditLineThicknessMm.Text,".",","))
    end if
    If Not IsPerfectlyNumeric(EditLineThicknessMm.Text) Then
    ...
    
  2. self-assigned this
    on Sep 24, 2015
  3. gbmhunter commented on Sep 24, 2015

    @gbmhunter
    Owner

    Thanks for reporting this bug and presenting a solution! I will add it to the code soon.

  4. gbmhunter commented on Sep 25, 2015

    @gbmhunter
    Owner

    Weird, I tried finding the exact reason why IsPerfectlyNumeric() function in Utils.vbs would be returning false, as all the tests inside that function are meant to be locale-aware (i.e. understand that you use a comma for the decimal separator).

    I tried change my locale to something that uses a comma with SetLocale(3079) (this changes the locale to Austria), however I couldn't get the code to recognise the comma.

    @SledgeH, would you be able to determine what part of the IsPerfectlyNumeric() function in Utils.vbs is returning false? There are three if statements in that function.

  5. qywx commented on Sep 25, 2015

    @qywx
    Author

    I will.

  6. reopened this on Sep 25, 2015
  7. qywx commented on Sep 25, 2015

    @qywx
    Author

    IsNumeric("1.2") returns false

  8. gbmhunter commented on Sep 27, 2015

    @gbmhunter
    Owner

    IsNumeric("1.2") returns true for me, presumably because my locale supports the period the . while yours supports the comma (,).

    However, this still supports the theory that the IsPerfectlyNumeric() function should work correctly for both locales. Would you be able to provide info on which part of IsPerfectlyNumeric() returns false for a number such as 1,2 (note that's a comma, not a period as you mentioned above) on your system.

  9. qywx commented on Sep 28, 2015

    @qywx
    Author

    which part of IsPerfectlyNumeric()...

    I supposed my answer was clear.

    IsNumeric("1.2") returns false

    And since it is part of IsPerfectlyNumeric(), IsPerfectlyNumeric() returns false.

    showmessage IsPerfectlyNumeric("1")          'true
    showmessage IsPerfectlyNumeric("1.2")        'false
    showmessage IsPerfectlyNumeric("1,2")        'true
    showmessage IsNumeric("1.2")                 'false
    
  10. qywx commented on Oct 9, 2015

    @qywx
    Author

    What about my pull request? It provides valid fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions