Skip to content

Instantly share code, notes, and snippets.

@mattjared
Created May 13, 2015 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattjared/8e22e9d78de45ea23f12 to your computer and use it in GitHub Desktop.
Save mattjared/8e22e9d78de45ea23f12 to your computer and use it in GitHub Desktop.
BNKoPP
<form>
<input id="userNumber" placeholder="write a value"/>
</form>
<div class="formatVal"></div>
function formatting(x) {
var y = x.substr(0, x.lastIndexOf(","));
$(".formatVal").html(y +'k' );
}
$('#userNumber').keyup(function(){
var x = $(this).val();
formatting(x);
});
html {
text-align: center;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment