Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8622765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:07:55+00:00 2026-06-12T07:07:55+00:00

Before anything you need to see the effect: jsFiddle As you can see it

  • 0

Before anything you need to see the effect:

jsFiddle

As you can see it is a calculator where you can put a value anywhere and covert it to other values, but the problem is that i cant enter decimal int values like 0.3 or 0.999. What is the cause of this?

var id = {
    mm: 1,
    cm: 10,
    m: 1000,
    km: 1000000
};

$('input.bx').on('keyup', function() {

    var t = $(this).val();
    var i = id[$(this).attr("id")];
    var v = parseInt(t, 10);

    for (pp in id) {

        if (t !== '') {
            $("#" + pp).val(v / id[pp] * i);
        } else {
            $(".bx").val('');
        }

    }

});

<input type='text' class='bx' id='mm'> Milimeter<br>
<input type='text' class='bx' id='cm'> Centimeter<br>
<input type='text' class='bx' id='m'> Meter<br>
<input type='text' class='bx' id='km'> Kilometer<br> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:07:57+00:00Added an answer on June 12, 2026 at 7:07 am

    a working fiddle here

    you have to use parseFloat and dont try to set the current focused element value cause you are over riding it while typing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can't see anything on here but I do remember being told that If
I need to launch an app I've made just after login, before anything else
I need to convert a string to another which has removed anything before the
(Before anyone says anything Yes this was homework but i have already turned it
Why do we need boost::thread_specific_ptr, or in other words what can we not easily
Information abound about syslog, but I can't find anything very concise for my interest.
Before anything, this is not necessarily a question.. But I really want to know
In wordpress I am trying to force user login first before see anything. Means
I've seen XML before, but I've never seen anything like EDI . How do
I've read XML or CSV before, but I've never seen anything like EDI. How

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.