Convert Digits into Words with JavaScript / jQuery

The “inword” is a well developed and multinational plugin for jQuery to convert digits / numbers values into words that can be fully control in JavaScript. This plugin is useful to covert any kind of numbers to words. It also supports decimal and minus values to display in words. You can display words output in multiple ways (like tooltip, helper or placer) with your custom position.

Moreover, the plugin is fully configurable and customizable with its available option.

[intro_ad]

Digits to Words Plugin Overview and Preview

Plugin: inword
Author: Khondoker Khalid Jahangir
Category: Text & Input
Published: January 20, 2024
File Type: zip archive (HTML, CSS & JavaScript )
Package Size: 13 KB
Dependencies: jQuery 3.0 or Latest version and Bootstrap 4.1.3
Last Modified:
MIT
4,791
[ad_after_overview]

Code Rating

[site_reviews_summary assigned_to=”post_id”]

How to Convert Digits Into Words With JavaScript

1. First of all, load the jQuery JavaScript library and Bootstrap into your webpage to getting started with inword plugin.

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<!-- Bootstrap CSS -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- Bootstrap JS -->
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>

2. Also, include the inword‘s CSS and JavaScript file in your HTML document.

<!-- inword CSS -->
<link rel="stylesheet" href="css/inword.css">
<!-- inword JS -->
<script src="js/inword.js"></script>

3. Create HTML input element with a unique id that will be used to input digits values. You can find the other using methods on demo page.

<input type="number" class="form-control" id="myNumbers">

4. Finally, call the inword plugin (with #myNumbers selector) in jQuery document ready function to display converted digits into words.

$(document).ready(function(){
	 $("#myNumbers").inword();
});

For more advance usage, please check the Configuration Options tab and demo page.

Changelog

23/11/2019

  • Create .gitattributes

19/10/2019

  • Initial release

Advance Configuration Options for JavaScript Digits Into Words Plugin

The following are advanced jQuery inword plugin configuration options to convert digits into words with JavaScript.

Option Default Type Description
type “helper” String Define the type of container where converted numbers will display. Possible options are: ‘tooltip’, ‘helper’ and ‘placer’.

Example:

$('element').inwords({
	type : "helper",
}); 
value null Number This option is useful to assign value to input. If you put value, it will be override original value.

Example:

$('element').inwords({
	value : null,
}); 
position “right” String The position value for tooltip and helper option.

Example:

$('element').inwords({
	position : "right",
}); 
color “#ffffff” String It define the text color.

Example:

$('element').inwords({
	color : "#ffffff",
}); 
backgroundColor “#47a3da” String Define the background color.

Example:

$('element').inwords({
	backgroundColor : "#47a3da",
}); 
placerId null String The id for placer element.

Example:

$('element').inwords({
	placerId : null,
}); 
wordJoiner ‘-‘ String The special character to join words like twenty-five.

Example:

$('element').inwords({
	wordJoiner : '-',
}); 
thousandSeperator “” String Separator for thousand.

Example:

$('element').inwords({
	thousandSeperator : "",
}); 
ignoreDecimal false Boolean Decide whether to ignore decimal values.

Example:

$('element').inwords({
	ignoreDecimal : false,
}); 
[site_reviews assigned_to=”post_id”]

Submit Your Review

[site_reviews_form assign_to=”post_id”]

[ad_after_artical]
About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...