Giter Club home page Giter Club logo

calculator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

calculator's Issues

Calculation issue with trailing operator

First off, excellent work on the jQuery calculator!

I have a couple of questions about how it's handling operators.

If I do the following...

  1. type 15 into my input field
  2. press the + key (this shows the popup calculator)
  3. type 30 into the calculator
  4. press the + key (the total updates to 45)
  5. type 15 into the calculator
  6. press the ENTER key

Doing the above closed the calculator and populates my input field with 60.

However, if you press the + key before pressing ENTER (step 6) to close the calculator the input field actually updates with 120.

It's like the last operator type affects the final calculation. Windows calculator works like this, but regular calculators don't always. It depends on what type of calculator it is.

Question 1: Is there a way to discard that last operator in the formula? Or is there a setting that controls this?

Question 2: Using a 10 key adding machine if I type 15+30+15+++++ would key adding the last value typed. So in this example you would end up with a total of 135. Does your calculator support this type entry?

Thanks,
Chris

Unable to compress locale files with YUI compressor

I get these weird ́╗┐' symbols before every locale related file and so the compression fails. I think you have created these files using visual studio which is inserting these BOM characters at the start of each file.
(You can open the file in command prompt and check)

Please make use of decimalChar

While pressing key from physical keyboard, if user have defined some specific decimalChar let say ',' it did not let user to add the decimalChar at all.
//Possible solution
_doKeyPress: function(e) {
..................
..................
if (plugin._showingCalculator || (div && !plugin.isDisabled(div))) {
var code = plugin._keyChars[ch === inst.options.decimalChar ? '.' : ch];
/**Change above line with => var code = plugin._keyChars[ch];*/
if (code) {
$('button[data-keystroke="' + code + '"]',
inst._mainDiv).not(':disabled').click();
}
return false;
}
..................
..................
},

Using it in a modal

Hello keith,
Can't find how to use it in a bootstrap modal.
It's hiding behind the modal.
Do you have a way for it.

<div class="modal fade " id="PopupCalc" role="dialog">
        <div class="modal-dialog " style="width: 450px">
            <div class="modal-content">
                <div class="modal-header">
                    Calculator
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div>
                <div class="modal-body">
                    <input type="text" id="basicCalculator">
                </div>
                <div class="modal-footer">
                    <a class="close btn btn-default" data-dismiss="modal">Cancel</a>
                </div>
            </div>
        </div>
    </div>

 $(function () {
 $.calculator.setDefaults({ showOn: 'both', buttonImageOnly: true, buttonImage: 'calculator.png' });
            $('#basicCalculator').calculator();
}

Bootstrap, angular and bower

I love Your calculator.
Have only 3 suggestions:

  1. Can You add Bootstrap 3 skin?
  2. Would be great if You can make angular version.
  3. And simpliest I think - bower version - Would be great installing it with bower.

option constrainInput doesn't seem to work

I tried to set constrainInput to false, but no effect on the calculator, still can't entry non-numeric characters.

When step into the code, keypress handler returned false before constrainInput is checked.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.