forked from price-format/Jquery-Price-Format
-
Notifications
You must be signed in to change notification settings - Fork 0
/
params.json
6 lines (6 loc) · 3.29 KB
/
params.json
1
2
3
4
5
6
{
"name": "Jquery-price-format",
"tagline": "jQuery Price Format Plugin is useful to format input fields and HTML elements as prices. For example, if you type 123456, the plugin updates it to US$ 1,234.56.",
"body": "#Jquery-Price-Format\r\n\r\njQuery Price Format Plugin is useful to format input fields and HTML elements as prices. \r\nFor example, if you type 123456, the plugin updates it to US$ 1,234.56.\r\n\r\nYes, we also have a prototype version but it is out of maintenace.\r\n\r\nIt is costumizable, so you can use other prefixes, separators, suffixes, plus sign, minus sign and so on. Check out the examples below.\r\n\r\n###Example 1 - Basic Usage\r\nThis is the most basic usage. It loads default options: use US$ as prefix, a comma as thousands separator and a dot as cents separator.\r\n\r\n\t$('#example1').priceFormat();\r\n\t\r\n\t// US$ 1,234.56\r\n\t\r\n###Example 2 - Use with any HTML element\r\nThe same basic usage as above, but now using an HTML id. Try it with classes also.\r\n\r\n\t$('#htmlfield').priceFormat();\r\n\t\r\n###Example 3 - Customize\r\nThis is a costumized format like brazilians use: R$ as prefix, a dot as cents separator and a dot as thousands separator. Play with the options centsSeparator and/or thousandsSeparator to better fit your site.\r\n\r\n\t$('#example2').priceFormat({\r\n prefix: 'R$ ',\r\n centsSeparator: ',',\r\n thousandsSeparator: '.'\r\n\t});\r\n\t\r\n\t// R$ 1.234,56\r\n\r\n###Example 4 - Skipping some option\r\nYou can skip some of the options (prefix, centsSeparator and/or thousandsSeparator) by set them blank as you need it in your UI.\r\n\r\n\t$('#example3').priceFormat({\r\n \tprefix: '',\r\n \tthousandsSeparator: ''\r\n\t});\r\n\t\r\n\t// 1234.56\r\n\t\r\n###Example 5 - Working with limits\r\nYou can set a limited length (limit) or change the size of the cents field (centsLimit) to better fit your needs.\r\n\r\n\t$('#example5').priceFormat({\r\n clearPrefix: true\r\n\t});\r\n\t\r\n\t// US$ 12.345\r\n\t\r\n###Example 6 - Clear Prefix and Suffix on Blur\r\nThe default value of clearPrefix and clearSuffix is false. Both work in same way.\r\n\r\n\t$('#example5').priceFormat({\r\n clearPrefix: true\r\n\t});\r\n\r\n\t// 1,234.56\r\n\t// on Blur > US$ 1,234.56\r\n\r\n###Example 7 - Allow Negatives\r\nThe default value of allowNegative property is false. Zero values will not be negative.\r\n\r\n\t$('#example6').priceFormat({\r\n allowNegative: true\r\n\t});\r\n\t\r\n\t// US$ -1,234.56\r\n\r\n###Example 8 - Add Suffix\r\nThe default value of suffix is empty.\r\n\r\n\t$('#example7').priceFormat({\r\n prefix: '',\r\n suffix: '€'\r\n\t});\r\n\t\r\n\t// 1,234.56€\r\n\t\r\n###Exemplo 9 - Unmask function\r\nReturn the value without mask. Negative numbers will return the minus signal.\r\n\r\n\t$('#example8').priceFormat();\r\n\tvar unmask = $('#example8').unmask();\r\n\talert(unmask); // alert 123456\r\n\t\r\n###Exemplo 10 - Plus sign\r\nSometimes show the plus sign can improve your usability. Since you allow this option you will automaticly allow the use of the minus sign.\r\n\r\n\t$('#example9').priceFormat({\r\n prefix: '',\r\n thousandsSeparator: '',\r\n insertPlusSign: 'true'\r\n\t});\r\n\t\r\n\t// +1234.56",
"note": "Don't delete this file! It's used internally to help with page regeneration."
}