Last active
February 20, 2021 14:06
-
-
Save vfontjr/13325d77aff636cd77fd75337666224a to your computer and use it in GitHub Desktop.
formidable_masterminds_numeral_demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
wp_enqueue_scripts( 'numeral-script', get_stylesheet_directory_uri() . '/js/numeral.min.js', array( '' ), '1.0.0', true ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/numeral.js/2.0.6/numeral.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery(document).ready(function ($) { | |
"use strict"; | |
$('#field_oqrnm').on("change", function() { | |
var raw_value = $(this).val(), | |
formatted_value = numeral(raw_value).format('$0,0.00'); | |
$(this).val(formatted_value); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment