#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Sacramento
    Posts
    3
    Rep Power
    0

    How to do Money mask on JSP page ?


    In a Bean i have some this like this:

    public vector getIncomeReport(){
    conn
    sql statement
    while(rs.next()){
    incomeReports.frBeginningBalance = rs.getDouble(1);
    }
    so i am getting the Amount value from the Oracle DB as getDouble, but actually in Oracle Column the value is
    something like this: 29383060.16 but on the JSP page it display as : 2.93830602E7.

    so How to get the money mask on the JSP page: like:

    2,93,83,060.16

    Any help greatly appreciated.

    Thanks in advance.
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Try using getString() instead of getDouble(). If that returns the results you want, then you can convert the string to a Double.
    -james
  4. #3
  5. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    Try looking into NumberFormat.getCurrencyInstance(). It is a static method that returns a NumberFormat object used to format numbers to their currency string, complete with dollar signs.


    http://java.sun.com/j2se/1.4/docs/ap...berFormat.html

IMN logo majestic logo threadwatch logo seochat tools logo