Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing decimal separator in numpad #318

Closed
ghost opened this issue Nov 20, 2014 · 2 comments
Closed

Changing decimal separator in numpad #318

ghost opened this issue Nov 20, 2014 · 2 comments

Comments

@ghost
Copy link

ghost commented Nov 20, 2014

Hello and thanks for this great keyboard,

I'm having a problem when changing the decimal separator from dot(.) to comma(,).

This is how i add a keyboard in a textarea:

    $(document).ready(function () {
       $('.keyboard').keyboard({
            layout: 'num',
            display: {
                'dec': ',:Decimal'
            }
        });
    });

Why is the decimal separator not changing though?
I tried reading through your code, but the keyset you pass as an argument when adding keys in the keyboard, the dot is always used.

@Mottie
Copy link
Owner

Mottie commented Nov 20, 2014

Hi @dnpall!

The problem here is that in the basic numpad, I forgot to replace the . with the {dec} action key. I'll fix this in the next update, but you can get around it by adding a custom numpad like this (demo):

$(function () {
    $('.keyboard').keyboard({
        layout: 'custom',
        customLayout: {
            'normal' : [
                '= ( ) {b}',
                '{clear} / * -',
                '7 8 9 +',
                '4 5 6 {sign}',
                '1 2 3 %',
                '0 {dec} {a} {c}'
            ]
        },
        display: {
            'dec': ',:Decimal'
        }
    });
});

@ghost
Copy link
Author

ghost commented Nov 21, 2014

Thank you very much, keep up the good work!

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

No branches or pull requests

1 participant