D
D
del9937882015-09-10 22:19:37
JavaScript
del993788, 2015-09-10 22:19:37

What is the address of format: wNumb({postfix: '10',})?

Hello. I'm trying to attach nouislider to jquery.change(). Essence: When select value changes then nouislider settings change. Here is the nouislider setup

var slider = document.getElementById('slider-range-format'),
     settings = {
    range: {
      'min': 0,
      'max': 120
    },
    start: [ 40, 60 ],
    margin: 2,
    step: 2,
    format: wNumb({
    decimals: 3,
    thousand: '.',
    postfix: '10',
  })
  };

There's a lot more code, but it doesn't really matter.
Suppose to change the value of min and max in range, you need to write the following code
$("#what").change(function(){
settings.range.min = [0, 30, 2][this.selectedIndex];
settings.range.max = [120, 200, 30][this.selectedIndex];
});


That is, for
range: {
      'max': 120
    },

The address will be like
settings.range.max

Prompt. What is the postfix address in the format section?
format: wNumb({
    decimals: 3,
    thousand: '.',
    postfix: '10',
  })

There's just a problem with wNumb itself. It goes through a colon. And I don't know how to describe it...
settings.format.postfix , settings.format.wNumb.postfix , settings.format:wNumb.postfix doesn't fit.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton, 2019-04-08
@karpos

https://jsfiddle.net/mwbhfg10/

S
Stimulate, 2019-04-08
@Stimulate

https://jsfiddle.net/ke6jx51o/

R
Rsa97, 2015-09-10
@del993788

wNumb - formatting library
Accordingly, it will be correct

settings.format = wNumb({decimals: 3, thousands: '.', postfix: <нужне значение>});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question