File: formatting.php

package info (click to toggle)
node-nouislider 15.8.1%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,936 kB
  • sloc: javascript: 5,234; php: 474; sh: 32; python: 28; makefile: 11
file content (36 lines) | stat: -rw-r--r-- 1,364 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php sect('formatting'); ?>
<h1>Number formatting</h1>

<section>

    <div class="view">

        <p>noUiSlider has a <code>format</code> option to configure both incoming and outgoing formatting.</p>

        <p>In this example, the slider format uses <strong>no decimals</strong>. The <code>tooltips</code> use <strong>one decimal</strong>.</p>

        <p>The <code>from</code> function takes a formatted value to parse. It gets a string and should return a number.</p>

        <p>The <code>to</code> function takes a number to format. It gets a number and should return a string.</p>

        <p>noUiSlider can optionally be used with the <code>wNumb</code> library for formatting. See <a href="../number-formatting/">the documentation on number formatting</a> for more details.</p>

        <div class="example">
            <div id="formatting-slider"></div>
            <span class="example-val" id="formatting-start"></span>
            <span class="example-val" id="formatting-end"></span>
            <?php run('formatting-format'); ?>
            <?php run('formatting'); ?>
        </div>
    </div>

    <div class="side">
        <?php code('formatting-format'); ?>

        <div class="viewer-header">Slider with formatting</div>

        <div class="viewer-content">
            <?php code('formatting'); ?>
        </div>
    </div>
</section>