Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81728

Currency Validation

$
0
0

I've loooked around but don't see a validator that validates currency when a person enters data in the field. I see a couple options for formatting a number in table view with a $, but not input validation.

I tried:

Field::inst( 'price' )->validator( 'Validate::numeric' ),

This works for input with an amount like 79.83 but in table view it renders (expectedly) without a $

I found this:

{ data: "price", render: $.fn.dataTable.render.number( ',', '.', 0, '$' ) },

but in table view it renders as a rounded whole number:

$80

This will confuse the administrator. How do I get it to render as $79.83?


Viewing all articles
Browse latest Browse all 81728

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>