1

I need to format the input value, the number in the center of the knob.

I've tried to incorporate the following format code, in different places both in the .js and .html files , without success:

.toLocaleString('no-NOK');

My HTML:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body { font-family:arial; }
input { color:#ffffff !important; font-size: 140% !important; }
#dial {  }
</style>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="jquery.knob.js"></script>
</head>
<body>
<div style="overflow:hidden;margin:auto auto;width:100%;background-color:orange;position:absolute;left:0;right:0;" align="center"><input type="text" id="dial" value="2000000"></div>
<script>
    $(function() {
    $("#dial").knob({
    'fgColor':"#000000",
    'lineCap':"round",
    'min':100000,
    'max':7000000,
    'step':100000,
    'width':250,
    'height':250,
    'format': function(v) {
return "Kr. " + v ;
}

});
    });


</script>

</body>
</html>
XhebbsX
  • 11
  • 1

1 Answers1

1

I think you have some mistake in script.

Try this

    http://codepen.io/AdelDima/pen/ueKrI
  • Thanks for Your feedback. My code Works, the issue at hand is the way the value is presented/formated in the middle. It says Kr. 2000000 - I want it to show Kr. 2 000 000 (Spaces after million and thousand). Here is my code in action: [link](http://kraft.aftenbladet.no/annonsetest/knob/) – XhebbsX Jun 13 '15 at 17:01