Coder Social home page Coder Social logo

angular-fcsa-number's People

Contributors

as3445 avatar jbulat avatar nferrel avatar olyism avatar paulyoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-fcsa-number's Issues

Have {maxDecimals: 0} enforce whole numbers

I have a use case where we don't want the user to enter in decimal values. We are using the following options:

fcsa-number="{ maxDecimals: 0, preventInvalidInput: true }

I would like for only numbers and commas to be allowed as input. However, I can still enter in a decimal value, I just get an error (red border). I'll see if I can throw a pull-request together for this, but wanted to submit this in case you had any ideas on built-in ways to achieve my use case.

Form value automatically emptied after blur (with values > 999)

If within an input field, the type is set to "number" as below, the form will be automatically emptied on blur if a number is entered that is greater than 999.

<input type="number" class="form-control" ng-model="payment" placeholder="100.00" required name="credit" fcsa-number="{min: 0, maxDecimals: 2}">

fcsa number failed at total field in case of add more

Problem scenario : We have product order form with Total field. User can add more products and add price. So we are doing total using angular directive and update Total field.

But price field with fcsa number directive value return undefined.

any sample example to solve this issue? I am sure some of you may have already face & solved this problem :-)

thanks for support

Decimal portion of an fcsa number is being formatted with commas

On blur the decimal portion of an fcsa number is being formatted with commas. Ideally the formatter will only add comma separators to the integer portion of the number.

Current behavior:
1123.45678 is formatted to 1,123.45,678

Correct behavior:
1123.45678 should be formatted to 1,123.45678

Can't override default options

Hi,

Despite the correct branch clone, I can't overide the default options for :

thousandsSeparator: '.',
decimalMark: ','

I'd like to put a space instead of '.' for the thousandsSeparator.

Thx for your help.

Apply as you type

Presume there is a good reason why it wasn't done already.. but is it possible to apply formatting change as you type rather than only on losing focus?

How to disable separator

Hello buddy ^_^,
I want to use this library for validate PIN,
so I don't need separator,
how to disable?

Model value is undefined

I don't know why.. but the model always returning me undefined..

<input type="text" fcsa-number="{ prepend: '$' }" class="form-control" placeholder="$(Maximum)" ng-model="investor.investment_range.max" />

Fcsa-number is not working properly with ng-submit directive of angular

I'm submitting a ...

[x] bug report

Current behavior
Fcssa-number is not working properly with ng-submit directive. Whenever I append or prepend anything using fcsa-number and submit the form it turns that field red and stores value in model as 'undefined'. It only shows this error on append or prepend without them it works fine.

Also if I remove ng-submit and use ng-click on submit button to call saveForm() function, it works fine while using prepend/append as well. It only shows error when using ng-submit directive

This is my code from a View.html

<form id="frmCostAndApproval" name="frmCostAndApproval" ng-submit=saveForm() novalidation>
  <div class="form-group">
      <label>Workup Sum Approved:</label>
      <input type="text" fcsa-number="{ prepend: '$' , preventInvalidInput: true }" class="form-control" name="WorkupSumApproved" ng-model="costAndApprovals.WorkupSumApproved" autocomplete="off" />
  </div>
  <div class="form-group">
       <label>AG2 Total Costs Approved:</label>
       <input type="text" fcsa-number="{ preventInvalidInput: true }" class="form-control" name="AG2TotalCostApproved" ng-model="costAndApprovals.AG2TotalCostApproved" autocomplete="off" />
  </div>
<button type="submit" class="btn btn-primary" ng-disabled="frmCostAndApproval.$pristine">
                        Submit
</button>
</form>

This is my code from a angular controller file ctrl-Cost&Approval.js

$scope.saveForm = function () {
            $scope.isProcessing = true;
            var item = angular.copy($scope.costAndApprovals);
            console.log(item);
}

This is my console window output

object
 WorkupSumApproved: undefined,
 AG2TotalCostApproved: 545452

Please guide me what the issue is and provide your help to the earliest. Looking forward for a positive response. Thank you.

Expected/desired behavior
The fields with prepend/append should not be undefined when form is submitted using ng-submit directive of AngularJs

About my environment:

  • AngularJS version: v1.4.1
  • angular-fcsa-number version: v1.5.3
  • Browser: [Chrome 51.0.2704.103 m |]

Dirty Form

Thank you for making such a great Directive.
My issue:
My form is always dirty after it loads since the addition of commas changes the values. Is there any way to resolve this issue?

my updates to this lib

Hi all!

some time ago we used to use this lib in my company project. I have made a bunch of changes and pushed it to the npm. After short interval it turned out that we will be switching to self-made stuff.

here is the gist where all patches attached - https://gist.github.com/ZuBB/85cf9e4ba28fd10b053b
if you need access to npm package -- let me know

npm package

It would be really nice if you made this available as an npm package πŸ‘

Add fractionSize to formatting

Great tool, thanks for providing.

Add ability to specify fraction size.

fcsa-number="{ fractionSize: 2 }"

100 formats like 100.00
100.1 formats like 100.10

Second feature request - support rounding method if user is allow to specify more then fractionSize.

The form does not validate the field if it has the "prepend" option.

I used this to create a currency field that prepended the "$" symbol. Everything worked well, but when I tried submitting the form it registered the field as invalid even though it was valid. Further testing showed that it tried to submit the "$" symbol along with the currency amount and I'm guessing this is why it considered the field as invalid. I tested this by prepending a number instead of a symbol and the form submitted fine but the submitted field value included the prepended number.

When using Kinoma to obtain the field value it strips off the prepended characters just fine, but it seems to have trouble doing this when the form is submitted.

I could not find any solution to this, so I went ahead and used the input-group feature from Bootstrap to add the currency symbol outside of the input field. However, it would be great to be able to submit forms using the prepend option from FCSA-Number in the future if possible.

model as string, expected number

because if must return a number returns a string?

It happens when the element is: <input type="text" fcsa-number />

check fcsaNumber.js line 121.

I suggest online 121:

return parseFloat(noCommasVal);

Thanks...

Different validation errors

Currently, all errors result in "fcsa-number" being set to true in $errors in the ngModelController. It would be great to get some granularity on why certain errors occur such as:

  • Invalid input
  • greater than max
  • less than min
    ..etc

angular-fcsa-number is not allowing input with commas

I noticed that angular-fcsa-number is not allowing input with commas. You may want to consider allowing commas as a valid input. I’m suggesting this because:

  1. This directive formats a number with commas after blur. This will likely increase a user’s expectation they are able to enter commas when typing a number
  2. Users may occasionally paste (and not type) a value in angular-fcsa-number. These strings may have commas.

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.