getting NaN on minimum price or maximum
See original GitHub issueI’m always getting NaN on minimum price and maximum, If the tow value s comes from a HTTP response. Maybe I should show the value asynchronsly any way.

This my component:
export class PriceFilterComponent implements OnChanges {
@Input() floor;
@Input() ceil;
@Output() eventEmitterFilter = new EventEmitter<{}>();
min: any;
max: any;
options: Options;
ngOnChanges() {
console.log(this.max); //undifined then NaN
if (this.floor && this.ceil) {
console.log(this.max); // NAN
this.max = Number(this.ceil.toFixed(0)) || 0;
this.min = Number(this.floor.toFixed(0)) || 0;
this.options = {
floor: this.floor,
ceil: this.ceil,
showSelectionBar: true,
selectionBarGradient: {
from: 'white',
to: '#007bff'
},
showOuterSelectionBars: true,
translate: (value: number, label: LabelType): string => {
return value + '€';
}
};
}
}
filter() {
this.eventEmitterFilter.emit({'ceil': this.max, 'floor': this.min});
}
}
This is the html side:<ng5-slider class="custom-slider" [(value)]="min" [(highValue)]="max" [options]="options" ></ng5-slider>
This a link for a deployed app Online demo, and the part of code source could be found here.https://github.com/ahmed-bhs/angular6-demo/blob/master/src/app/article/price-filter/price-filter.component.ts
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
getting NaN on minimum price or maximum · Issue #54 - GitHub
I'm always getting NaN on minimum price and maximum, If the tow value s comes from a HTTP response. Maybe I should show...
Read more >max() and min() returns np.nan when the np array starts with ...
NaN values are propagated, that is if at least one item is NaN, the corresponding max value will be NaN as well. To...
Read more >Cost function turning into nan after a certain number of iterations
Well, if you get NaN values in your cost function, it means that the input is outside of the function domain. E.g. the...
Read more >What does NaN mean? - Flexera CMP Docs
NaN is short for Not a Number. NaN indicates that the monitoring system is not receiving any numeric data. There can be several...
Read more >How to Use min() and max() in R - DigitalOcean
The min and max functions can be used in both numerical as well as character vectors. You can also remove the NA values...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Can you please re-test your code with v1.1.12?
I just added a fix for a bug from #56. I think it should solve the problem of NaN values in this case.