Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Comma/Dot?

krisjanis_zarinskrisjanis_zarins Member Posts: 2
edited April 2015 in Product Feedback
Using a non US keyboard I have a issue with my NumPad. My old keyboard/my language settings has comma on the NumPad, not a dot. OnS does not recognize both witch really bugs me. Every single precise dimension must be typed using a dot witch is far away and disturbs my workflow. 

Could there be a fix for this? Otherwise you guys are doing a great job! I can imagine becoming a engineering freelancer when such software runing on GNU/Linux is available. Other packages are way too expensive to afford in my region. 
Tagged:

Answers

  • moengineeringmoengineering Member Posts: 23
    edited April 2015
    Hello @krisjanis_zarins

    you can change your windows settings to get the point and not the comma. I had the same issue in another CAD program, and my solution was to add the American Keyboard and so I can switch between the english and german keys.

    Here is an english description for windows. Don't know which Linux version you run, but the settings should be the same ;)


    best regards
    martin


    Edit: Screenshot added
  • krisjanis_zarinskrisjanis_zarins Member Posts: 2
    I agree @3dcad. If the software is intended for any device with a browser, maybe not even my own device, the user interface should be user friendly for any keyboard configuration. 
  • Sindre_AbrahamsenSindre_Abrahamsen Member Posts: 5
    In solidworks, both comma and dot would result in a decimal dimension. I think in programming, there is a difference, but when engineers specify dimensions, 20.5 mm would be equal to 20,5 mm.
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    In solidworks, both comma and dot would result in a decimal dimension. I think in programming, there is a difference, but when engineers specify dimensions, 20.5 mm would be equal to 20,5 mm.

    Sorry but that's not my experience.  In the UK a comma is simply a separator per thousands to aid visibility; a dot denotes a decimal point.
    So here:-
    1,000,000 = 1000000 = 1 000 000
    1,000 = 1000 (Not 1)
    1,000.1 (One thousand and one tenth)
    1,00 (Not valid as in the wrong place for delimiting a thousand and not a decimal point)

    So for me at least 20.5 is not equal to 20,5
    It's easy to see how a mars lander might miss by an order of magnitude!
    Cheers, Owen S.

     
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • Sindre_AbrahamsenSindre_Abrahamsen Member Posts: 5
    Onshape does not recognise the comma as a thousands separator. I would like to use my numpad for entering decimals, but the comma just throws off an error. 
  • Sindre_AbrahamsenSindre_Abrahamsen Member Posts: 5
    In the UK a comma is simply a separator per thousands to aid visibility; a dot denotes a decimal point.
    So here:-
    1,000,000 = 1000000 = 1 000 000 
    Totally off topic, but is it possible to use another notation for that? examples: 1e6, 1M, 1x10^6
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    @Sindre_Abrahamsen - I believe the comma denoting decimals is used mostly in Europe and South America, everywhere else uses the decimal point. We have discussed allowing both, but the issue arises when writing equations in place of values. For example, an equation driven from an array that uses commas to separate values not decimals. It's complicated for sure.
    Senior Director, Technical Services, EMEAI
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714
    And yes, you can use 1e6
    Senior Director, Technical Services, EMEAI
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    @NeilCooke  Similar issue here with some automation barcodes that had worked for years right up to the point they didn't.  Turned out we ha some new customer accounts with commas in the customer's name.  That didn't play nicely when encoded into a comma separated variable string. :s:(  Red faces that day.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • 3dcad3dcad Member, OS Professional, Mentor Posts: 2,475 PRO
    I hate these comma, dot, etc. formats. I suffer with onshape everytime not being able to use numpad. Then again I could change the setting but then I have problems with other software. Same goes with erp vs windows settings timestamp can be 08:55:30 or 08.55.30 - calculation between the two obviously doesn't work..

    I did make a strong request for allowing dot and comma back in 2015 or so. Maybe a complete table for separators into user configurations is needed? Excel and google sheets works so why couldn't Onshape.

    I would use ',' for decimal and ';' as separator in arrays etc.. for computer they could be '§' and '&' or 'a' and 'b' .. don't make it complicated, they are only parameters that can be anything if you consider this when coding.
    //rami
  • bradley_saulnbradley_sauln Moderator, Onshape Employees, Developers Posts: 373
    I have found some untested but seemingly valid ways to remap a comma to a period on the keypad/numpad for our users that utilize the comma in place of a decimal point...

    Windows: https://superuser.com/questions/747250/dot-instead-of-comma-on-numerical-keyboard

    Mac: https://apple.stackexchange.com/questions/229509/apple-keyboard-remap-keypad-comma-to-dot

    I don't have any physical devices on-hand with a comma configuration to test these myself so if you bravely attempt one of these. Let us know about your experience.
    Engineer | Adventurer | Tinkerer
    Twitter: @bradleysauln


  • 3dcad3dcad Member, OS Professional, Mentor Posts: 2,475 PRO
    @bradley_sauln
    The problem is Onshape being the only software where I would like to have dot on numpad - for everything else I need it to be comma. Only solution would be browser extension to recognize onshape and make the swap - sounds like a big hassle with plenty of headache..
    //rami
  • Sindre_AbrahamsenSindre_Abrahamsen Member Posts: 5
    I have found some untested but seemingly valid ways to remap a comma to a period on the keypad/numpad for our users that utilize the comma in place of a decimal point...

    Mac: https://apple.stackexchange.com/questions/229509/apple-keyboard-remap-keypad-comma-to-dot

    Let us know about your experience.
    I tried this on my Mac, but it does not work. I suspect Apple changed this after Catalina upgrade which I run.
  • 3dcad3dcad Member, OS Professional, Mentor Posts: 2,475 PRO
    edited February 2020
    Onshape is asking us to input text instead of number?
    It should allow anything as decimal separator what is set to be decimal separator in current system. Same goes for list separator.


    //rami
  • albjerrealbjerre Member Posts: 23 ✭✭✭
    @NeilCooke You could translate “European” inputs to “American” inputs on the fly when a user submits an input in an input field, so the code always operates internally with dots as decimal separator and commas as input separator. In Excel, we Europeans normally use semicolons as input separators instead of commas in formulas. So you could translate that on the fly as well.
  • nicholas_kerslakenicholas_kerslake Member Posts: 2
    Hey don't know if this has been answered definitively as this thread seems to cover a lot, however I have found the setting to change in Onshape if you do want decimals on your drawing dimensions instead of commas.

    On the far right of the workspace click the little spanner icon for "Drawing Properties" then change the Decimal Separator drop down option from comma to period. Hope this helps someone.

     
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
    edited April 2022
    NeilCooke said:
    @Sindre_Abrahamsen - I believe the comma denoting decimals is used mostly in Europe and South America, everywhere else uses the decimal point. We have discussed allowing both, but the issue arises when writing equations in place of values. For example, an equation driven from an array that uses commas to separate values not decimals. It's complicated for sure.
    Why dont you make it optinal for each user in his own settings? So you can go to settings and select the period version or the comma version.
    Like in the Drawings. (What @nicholas_kerslake said.)

    I mean it is possible for each rotational movement (if you came from solidworks or other CAD-Software) why dont also make it possible for this kind of setting?


    @NeilCooke @lougallo @bradley_sauln
    Best regards
    Best regards,

    Axel Kollmenter
  • Axel_KollmenterAxel_Kollmenter Member Posts: 415 PRO
     
    Best regards,

    Axel Kollmenter
  • tindantindan Member Posts: 3
    Workaround
    I found a workaround using AutoHotKey to switch numpad ',' to '.' only in OnShape document web pages. However the script looks at the window/tab title to identify when to do the switch and unfortunately the titles only contain the document title and document tab so there's no fixed string to search for. I solved that by installing the extension Tab Modifier to change the title name.

    Tab Modifier for Chrome based browser
    https://chrome.google.com/webstore/detail/tab-modifier/hcbgadmbdkiilgpifjgcakjehmafcjai
    Name: Whatever you want
    Detection: Contains
    URL fragment: cad.onshape.com
    Title: Onshape

    AutoHotkey script
    https://www.autohotkey.com/
    ;Remap ',' numpad key to '.' to support OnShape decimal numbers
    SetTitleMatchMode 2  ;2: anywhere in title
    #IfWinActive OnShape  ;if 'OnShape' in the title
    NumPadDot::
    Send, .
    return
  • Thiago_RabelloThiago_Rabello Member Posts: 6
    I have another "Workaround" for this, but I agree it should be set in the user preference as stated above.
    What worked for me (since I can't install Chrome extensions due to company policy) was to create another system keyboard using Microsoft's own app for that (https://www.microsoft.com/en-us/download/details.aspx?id=102134) and remapped the numpad comma key to be a dot.
    After compiling the project, run the setup, reboot the computer and choose the preferred keyboard.
  • _anton_anton Member, Onshape Employees Posts: 413
  • cj_fokscj_foks Member Posts: 2

    Adding selection between comma and dot in "My account > Preferences" Would sole this problem.

  • colellacolella Member Posts: 1 EDU
    edited November 8

    I just wanted to use my numpad with a non-US keyboard, I don't get why this has to be such a headache. The decimal separator in the numpad usually just registers as <Num .> no matter your layout and whatever system you're using should interpret that into comma or dot, depending on which you prefer.

    Since I wanted to continue using dot with my non-US keyboard without having to go back and forth between keyboard layouts just for OnShape, I found an extension for Chrome that allows exactly that. It's called Tampermonkey and let's you create some JS scripts for Chrome.

    If anyone needs this, here's my script:

    // ==UserScript==
    // @name Onshape Numpad Decimal Override
    // @namespace http://tampermonkey.net/
    // @version 1.0
    // @description Map numpad decimal to period on Onshape
    // @match ://.onshape.com/*
    // @grant none
    // ==/UserScript==

    (function() {
    'use strict';

    // Listen for keydown events on the document
    document.addEventListener('keydown', function(event) {
    // Check if the event is the Numpad Decimal key
    if (event.code === 'NumpadDecimal') {
    // Prevent the default action of the key
    event.preventDefault();

    // Insert a period (.) instead
    const activeElement = document.activeElement;

    // If the active element is an input or a text area
    if (activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA')) {
    // Insert the period at the cursor position
    const start = activeElement.selectionStart;
    const end = activeElement.selectionEnd;
    activeElement.value = activeElement.value.slice(0, start) + '.' + activeElement.value.slice(end);
    // Move the cursor after the inserted period
    activeElement.selectionStart = activeElement.selectionEnd = start + 1;
    } else {
    // For other areas, simulate typing a dot
    document.execCommand('insertText', false, '.');
    }
    }
    });

    })();

Sign In or Register to comment.