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

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현