• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to format number as money in javascript? e.g 1000 to 1,000

 
chrstian ferma
Ranch Hand
Posts: 72
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to format number as money in javascript? e.g 1000 to 1,000
eg. 100000000 then it will be format into 1,000,000,000 can you give me some ideas thank you
 
Luan Cestari
Ranch Hand
Posts: 172
C++ Redhat Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would use http://numeraljs.com/
 
Devaka Cooray
ExamLab Creator
Marshal
Pie
Posts: 4598
303
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use JSTL functions as in <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>, and use its formatNumber tag:

<fmt:formatNumber type="number" value="${your_number_here}" />
 
chrstian ferma
Ranch Hand
Posts: 72
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thaks man , i also use the but i use that when i getting the values from database for editing this is what i did i just want to share

need a function document.ready so that every time the page loads the function is working then pass the id to of textbox in that function $('#textboxid').mask(the masking format here e.g 99/99/9999)

then in controller convert the value from string to double before inserting into database then it works, just need the jqeury maskingplug in on eclipse then it works thanks correct me if im mistaken. :)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic