input number 11 decimals with pipe doesnt allow number > 999How to round a number to n decimal places in JavaHow do you round a number to two decimal places in C#?Limit to 2 decimal places with a simple pipeWhat are the parameters for the number Pipe - Angular 2Angular 2: Cursor issue with “number” pipe on ngModel inputAngular2 filter table based on two inputs using custom pipeformat number in input box with two decimal placeAngular pipe with multiple patternsWhen to call pipe from the controller when there's a change on the input values?HostListener onBlur and onFocus not getting fired in angular4

Would a "ring language" be possible?

Is there a method to separate iron from mercury?

Cross products/avoiding using your hand for the right hand rule in E and M

Canadian citizen who is presently in litigation with a US-based company

Is Precocious Apprentice enough for Mystic Theurge?

What would a Dragon have to exhale to cause rain?

Why are there five extra turns in tournament Magic?

How can I safely determine the output voltage and current of a transformer?

Why are lawsuits between the President and Congress not automatically sent to the Supreme Court

He is the first man to arrive here

Roman Numerals Equation 2

Square spiral in Mathematica

Divisor Rich and Poor Numbers

Five Powers of Fives Produce Unique Pandigital Number...Solve for X..Tell me Y

Is it standard to have the first week's pay indefinitely withheld?

Why is the marginal distribution/marginal probability described as "marginal"?

Do high-wing aircraft represent more difficult engineering challenges than low-wing aircraft?

Is there any deeper thematic meaning to the white horse that Arya finds in The Bells (S08E05)?

Would life always name the light from their sun "white"

Working hours and productivity expectations for game artists and programmers

Is there an academic word that means "to split hairs over"?

Pedaling at different gear ratios on flat terrain: what's the point?

Why would you put your input amplifier in front of your filtering for and ECG signal?

What is the velocity distribution of the exhaust for a typical rocket engine?



input number 11 decimals with pipe doesnt allow number > 999


How to round a number to n decimal places in JavaHow do you round a number to two decimal places in C#?Limit to 2 decimal places with a simple pipeWhat are the parameters for the number Pipe - Angular 2Angular 2: Cursor issue with “number” pipe on ngModel inputAngular2 filter table based on two inputs using custom pipeformat number in input box with two decimal placeAngular pipe with multiple patternsWhen to call pipe from the controller when there's a change on the input values?HostListener onBlur and onFocus not getting fired in angular4






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















999.12345678901 works but anything >= 1000 valuates to NaN (warning in console) and sets input to 0. I am using this Pipe in onBlur of input.



 @Pipe(
name: 'rExact'
)
export class rExactPipe extends DecimalPipe
transform(value: number): any
if(isNaN(value))
return null;

return super.transform(value, "1.2-11");




this is the onblur event:



this.selected.UnitPrice = +new rExactPipe(this.numberLocale).transform(this.selected.UnitPrice);


the input number field is binded like this: [(ngModel)]="selected.UnitPrice"



all numbers should work up to 15digits float because js is 64bit. what am i doing wrong?










share|improve this question






















  • Can't reproduce: stackblitz.com/edit/…. Post a complete minimal example, as I just did, but reproducing the problem.

    – JB Nizet
    Mar 23 at 16:50

















0















999.12345678901 works but anything >= 1000 valuates to NaN (warning in console) and sets input to 0. I am using this Pipe in onBlur of input.



 @Pipe(
name: 'rExact'
)
export class rExactPipe extends DecimalPipe
transform(value: number): any
if(isNaN(value))
return null;

return super.transform(value, "1.2-11");




this is the onblur event:



this.selected.UnitPrice = +new rExactPipe(this.numberLocale).transform(this.selected.UnitPrice);


the input number field is binded like this: [(ngModel)]="selected.UnitPrice"



all numbers should work up to 15digits float because js is 64bit. what am i doing wrong?










share|improve this question






















  • Can't reproduce: stackblitz.com/edit/…. Post a complete minimal example, as I just did, but reproducing the problem.

    – JB Nizet
    Mar 23 at 16:50













0












0








0








999.12345678901 works but anything >= 1000 valuates to NaN (warning in console) and sets input to 0. I am using this Pipe in onBlur of input.



 @Pipe(
name: 'rExact'
)
export class rExactPipe extends DecimalPipe
transform(value: number): any
if(isNaN(value))
return null;

return super.transform(value, "1.2-11");




this is the onblur event:



this.selected.UnitPrice = +new rExactPipe(this.numberLocale).transform(this.selected.UnitPrice);


the input number field is binded like this: [(ngModel)]="selected.UnitPrice"



all numbers should work up to 15digits float because js is 64bit. what am i doing wrong?










share|improve this question














999.12345678901 works but anything >= 1000 valuates to NaN (warning in console) and sets input to 0. I am using this Pipe in onBlur of input.



 @Pipe(
name: 'rExact'
)
export class rExactPipe extends DecimalPipe
transform(value: number): any
if(isNaN(value))
return null;

return super.transform(value, "1.2-11");




this is the onblur event:



this.selected.UnitPrice = +new rExactPipe(this.numberLocale).transform(this.selected.UnitPrice);


the input number field is binded like this: [(ngModel)]="selected.UnitPrice"



all numbers should work up to 15digits float because js is 64bit. what am i doing wrong?







angular pipe decimal html5-input-number






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 23 at 16:37









Andreas OwenAndreas Owen

186




186












  • Can't reproduce: stackblitz.com/edit/…. Post a complete minimal example, as I just did, but reproducing the problem.

    – JB Nizet
    Mar 23 at 16:50

















  • Can't reproduce: stackblitz.com/edit/…. Post a complete minimal example, as I just did, but reproducing the problem.

    – JB Nizet
    Mar 23 at 16:50
















Can't reproduce: stackblitz.com/edit/…. Post a complete minimal example, as I just did, but reproducing the problem.

– JB Nizet
Mar 23 at 16:50





Can't reproduce: stackblitz.com/edit/…. Post a complete minimal example, as I just did, but reproducing the problem.

– JB Nizet
Mar 23 at 16:50












1 Answer
1






active

oldest

votes


















2














the problem is DecimalPipe adds , symbol after thousands like here 1,000 and in your code this small plus here +new converts result back to number. this comma makes it unparsable, and, as a result you get NaN. to fix the issue for the view just remove the plus sign, and, if you need value, use it without pipe






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315977%2finput-number-11-decimals-with-pipe-doesnt-allow-number-999%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    the problem is DecimalPipe adds , symbol after thousands like here 1,000 and in your code this small plus here +new converts result back to number. this comma makes it unparsable, and, as a result you get NaN. to fix the issue for the view just remove the plus sign, and, if you need value, use it without pipe






    share|improve this answer



























      2














      the problem is DecimalPipe adds , symbol after thousands like here 1,000 and in your code this small plus here +new converts result back to number. this comma makes it unparsable, and, as a result you get NaN. to fix the issue for the view just remove the plus sign, and, if you need value, use it without pipe






      share|improve this answer

























        2












        2








        2







        the problem is DecimalPipe adds , symbol after thousands like here 1,000 and in your code this small plus here +new converts result back to number. this comma makes it unparsable, and, as a result you get NaN. to fix the issue for the view just remove the plus sign, and, if you need value, use it without pipe






        share|improve this answer













        the problem is DecimalPipe adds , symbol after thousands like here 1,000 and in your code this small plus here +new converts result back to number. this comma makes it unparsable, and, as a result you get NaN. to fix the issue for the view just remove the plus sign, and, if you need value, use it without pipe







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 23 at 17:43









        AndreiAndrei

        69117




        69117





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55315977%2finput-number-11-decimals-with-pipe-doesnt-allow-number-999%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

            밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

            1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴