facebook

Samsung Numeric Keyboard

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #348306 Reply

    rolbiec1
    Member

    I am creating an app to do calculations which require a decimal point. One problem that I have come across is that the Samsung numeric keyboard does not have an option for a decimal point when using inputting numbers when I select the numeric option input in MobiOne.
    Here is what it looks like:

    Is there a way to get a decimal point option in one of the blank boxes?

    I was hoping for something like this:


    (Screenshot from Triathlete’s Diary app)

    Is there any way to achieve this?

    #348316

    Brandon
    Member

    Probably not as that would be device level. You could try adding a decimal point using javascript. Use the textboxes on change call to add the point:

        <script type="text/javascript">
          function intFormat(n)
          {
            var
              regex = /(\d)((\d{3},?)+)$/;
            
            n = n.split(',').join('');
            
            while(regex.test(n))
            {
              n = n.replace(regex, '$1,$2');
            }
            
            return n;
          }
          function numFormat(n)
          {
            var
              pointReg = /([\d,\.]*)\.(\d*)$/, f;
            
            if(pointReg.test(n))
            {
              f = RegExp.$2;
              return intFormat(RegExp.$1) + '.' + f;
            }
            return intFormat(n);
          }
        </script>
    #348612

    rolbiec1
    Member

    I believe this is the code for making a decimal point show up:

    <input type=”text” pattern=”[0-9.]*”></input>

    I’m not sure how to work it in the code to get it to work though. Where/how can I add this?

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Samsung Numeric Keyboard

You must be logged in to post in the forum log in