1
votes

Here's my declaration in my angular 2 project:

<nouislider  [connect]="true" [min]="2.79433548546" [max]="18.5525702846" [(ngModel)]="selectedRange" [tooltips]="[true, true]" ></nouislider>

Initially selectedRangeis correctly set to [2.79433548546, 18.5525702846]. However, as soon as I move the lower bound slider, numbers are rounded off so selectedRange becomes [2.79, 18.55]. 18.5525702846 is clearly not in this range so it is excluded from the sliding criteria. Any ideas of to avoid this?

1

1 Answers

0
votes

Formatting to two decimals is the default. You can pass another formatter (using [format]="formatter" or [config]="config" in your declaration).

formatter or config.format would look like this:

format: {
    to: String,
    from: Number
}