garth....@gmail.com

unread,
Jun 17, 2014, 11:12:55 PM6/17/14
to mitappinv...@googlegroups.com
I am building a tax calculator which uses a recurring decimal. It appears that the recurring decimal equation eventually become incorrect if to many numbers are used in the equation. I really need a way to limit the characters that can be input into a textbox to somewhere around 15 max so that the number is correct when calculated. Ideally i would like a solution that stops digits from being entered into the textbox once they reach the predefined limit. I haven't found any information on this here or on YouTube etc etc. Any ideas? Thanks.

Stephen Zipprich

unread,
Jun 18, 2014, 12:08:22 AM6/18/14
to mitappinv...@googlegroups.com
You can do this with the clock.  See this image.  Set the interval of the clock to 50 milliseconds.


garth....@gmail.com

unread,
Jun 18, 2014, 4:48:17 AM6/18/14
to mitappinv...@googlegroups.com
Cheers for the suggestion. It works in part. Problem with it mostly is that the text disappears once you exceed the set character limit. I need a solution that leaves the limited amount of numbers intact and wont allow others to be entered. There also appears to be an issue with the cursor re-positioning depending on whether the text is set to the left or the right.

I saw a feature request for changes to the component properties asking to add a field to set the character limit however it hasn't been undertaken for whatever reason. I'm fairly new to AI however its looking like a great solution to a very real and unresolved problem.

SteveJG

unread,
Jun 18, 2014, 7:45:01 AM6/18/14
to mitappinv...@googlegroups.com
Use the Text length possibly.

if length textbox1.text > 15 then  show notifier message and close the keyboard might work

However, your issue really seems to be an issue of decimal precision.  Without seeing your equation, can't really tell.
Look at the Math functions   round and  format as decimal
                                                                           number
                                                                            places

and put the textbox1.text in the number   and set places to 15       if this is the issue.

                                                          format as decimal
                                                                           number   textbox1.text
                                                                            places   15

Good luck.   Hope this helps.

Regards,
Steve

Stephen Zipprich

unread,
Jun 18, 2014, 12:46:04 PM6/18/14
to mitappinv...@googlegroups.com
Cheers for the suggestion. It works in part. Problem with it mostly is that the text disappears once you exceed the set character limit. I need a solution that leaves the limited amount of numbers intact and wont allow others to be entered. There also appears to be an issue with the cursor re-positioning depending on whether the text is set to the left or the right.


What about this?

This retains whatever's entered and keeps anything else from being added.  Am I misunderstanding what you're asking for?

garth....@gmail.com

unread,
Jun 19, 2014, 7:09:33 AM6/19/14
to mitappinv...@googlegroups.com
I dropped setting the enabled textbox to false as it wasn't what i was after and it seemed to be freezing in a disabled state. I included set hide keyboard instead. It seems to work now. I may also add a notifier as previously suggested. If I find issues with this solution I will make note of it here, if the topic remains open. Cheers.
Reply all
Reply to author
Forward
0 new messages