27 lines
1.1 KiB
Plaintext
27 lines
1.1 KiB
Plaintext
<script>
|
|
/**
|
|
* Number.prototype.format(n, x, s, c)
|
|
*
|
|
* @param integer n: length of decimal
|
|
* @param integer x: length of whole part
|
|
* @param mixed s: sections delimiter
|
|
* @param mixed c: decimal delimiter
|
|
*/
|
|
Number.prototype.format = function(n, x, s, c) {
|
|
var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\D' : '$') + ')',
|
|
num = this.toFixed(Math.max(0, ~~n));
|
|
|
|
return (c ? num.replace('.', c) : num).replace(new RegExp(re, 'g'), '$&' + (s || ','));
|
|
};
|
|
</script>
|
|
<script>hljs.initHighlightingOnLoad();</script>
|
|
<!-- Bootstrap 4 core JavaScript -->
|
|
<script src="/javascripts/tether.min.js"></script><!-- tether za bootstrap ... -->
|
|
<script src="/javascripts/bootstrap.min.js"></script><!-- Bootstrap 4.0-alpha.2 -->
|
|
<!-- skripta strani -->
|
|
<script src="/javascripts/scripts.js"></script>
|
|
<!-- ChartJS -->
|
|
<script src='/javascripts/moment.js'></script>
|
|
<script src='/chart.js/dist/Chart.js'></script>
|
|
<script src='/chart.js/dist/Chart.bundle.js'></script>
|