Skip to first unread message

Canal da Poeira - Felipe Miranda

unread,
Jun 2, 2016, 9:26:52 PM6/2/16
to MIT App Inventor Forum

Hi.

I'm trying to use the textbox with "NumberOnly" on.
but I'm developing an app for Brazilian users, and at Brazil they use comma as a decimal separator.
The textbox doesn't accept comma, only dot.
Is there any way to change that?

Abraham Getzler

unread,
Jun 2, 2016, 11:02:41 PM6/2/16
to MIT App Inventor Forum
I don't know how to fix that, but I can suggest how to work around it ...

Turn off the text box's Numbers Only attribute, and instead  run a fast clock that check's the last digit entered against "0123456789,"
and chops off the end if it's not acceptable.

The keyboard doesn't look numeric, though.

Alternatively, you could pop up your own arrangements of buttons to act as a numeric keyboard,
with buttons for 0-9, comma, clear, and Done, and a label to show the number in progress.

ABG
2016-06-02 23_01_23-Greenshot.png

Italo

unread,
Jun 2, 2016, 11:23:55 PM6/2/16
to MIT App Inventor Forum
Another solution could be to let the user input the numbers like in an ATM, where the last 2 digits typed are always the decimals. If you do it like that, the user don't need to type a point or a comma.

Abraham Getzler

unread,
Jun 3, 2016, 9:17:14 AM6/3/16
to MIT App Inventor Forum
+1 @Italo
ABG

ScottFerguson

unread,
Jun 3, 2016, 11:14:20 AM6/3/16
to MIT App Inventor Forum
Here is my solution:

(the textbox NumbersOnly property is not checked)



CommaToDecimal.aia

Abraham Getzler

unread,
Jun 3, 2016, 11:41:30 AM6/3/16
to MIT App Inventor Forum
Attached is my overkill solution, with @Italo's ATM machine keyboard idea, using blanks for thousands and comma for decimal point,
parametrizable, and usable for multiple input fields with a little more work.

ABG

2016-06-03 11_34_56-5554__build_.png
clkCursor_Timer.png
cursor.png
Designer.png
digit_buttons.png
dollars.png
format.png
refresh_input.png
Screen1_Initialize.png
start_input.png
stop_input.png
2016-06-03 11_35_30-5554__build_.png
thousandizer.png
2016-06-03 11_36_00-5554__build_.png
accept_digit.png
Brazilian_Numbers.aia
btnClear.png
btnDone.png
btnInputAmount_Click.png
cents.png
Reply all
Reply to author
Forward
0 new messages