1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Para Birimi Cevirici</title> <script src="jquery-1.7.min.js"></script> <script src="jquery.number.js"></script> </head> <body> <h2>Para Formatı</h2> <h3>id göre otomatik </h3> <input type="text" id="price"> <h3>sayı gir</h3> <input type="text" id="manuelPrice"> <br> <button onclick="btnGonder()">Gönder</button> </body> </html> <script type="text/javascript"> $(function(){ $('#price').number( true, 2 ); }); function btnGonder() { var deger=parseFloat($("#manuelPrice").val()); alert($.number(deger, 2,',')); } </script> |
Bu para birimi formatı değil. Virgülden sonraki basamak sayısını ayarlıyorsun sadece.