Open tirolel opened 4 years ago
Hi @tirolel!
I guess it's not super-obvious, or documented that well, but the display
option has a dec
setting (demo)
display: {
// Decimal point for num pad (optional), change '.' to ',' for European format
dec: ".:Decimal";
}
.
to the left of the colon sets the decimal value for the keyboard.Decimal
text to the right of the colon sets the keyboard key title (seen on hover)So for a Belgium keyboard, you can use dec: ',:Decimal'
. I did try to include the common formatting in the language files (e.g. German), but not all languages have corresponding files.
The {dec}
key is set up to only allow the user to type in that decimal character once. You just have to be cautious not to also include the comma key in the layout as it isn't disabled.
Thank you @Mottie for your fast response.
Yes I see and I just have tested the decimal option, and works flawlessly! The reason is, I do have a screen is very small(480x270) and I made custom layouts for each language(tough work)
Also I have a question about a feature(s). Can i add my own custom button?
Yes, they are called action keys.
Hi @Mottie.
Iam wondering if the keyboard does allow this scenario.
Iam using numbro to support locale options that can be used on my webapp. I have already defined some languages(decimal & thousand seperators) in numbro.
Is there anyway I can specify an option to keyboard about what is my decimal & thousand seperators? So when I show a custom num layout, it should validate the number regarding the defined option?
E.g. A user with from Belgium has these options: delimiters: { thousands: " ", decimal: "," }
When the user clicks an input field, it should show the numeric keyboard with the given "," decimal seperator & and if the user enters "1000.00" , it should be like "1 000,00". Also its important to user can add only single decimal.
Can this be done?
Thanks in advance! Best regards.