Menu

#46 Bigdecimal scale is not set for createFromDouble

open
None
5
2006-06-26
2006-06-26
bjlai
No

When I call createFromDouble is should automatically
set the scale to the default scale for the object.

public static Price createFromDouble( double
pSourceDoubleValue) throws DataTypeValidationException
{
// No need to perform special validation
try
{
return createFromBigDecimal(new
BigDecimal(pSourceDoubleValue));
}
catch(NumberFormatException e)
{
throw new DataTypeValidationException(e);
}
}

should be something like:

public static Price createFromDouble(double
pSourceDoubleValue) throws DataTypeValidationException
{
// No need to perform special validation
try
{
BigDecimal lSourceDoubleValue = new
BigDecimal(pSourceDoubleValue);
lSourceDoubleValue =
lSourceDoubleValue.setScale(sScale);
return
createFromBigDecimal(lSourceDoubleValue);
}
catch (NumberFormatException e)
{
throw new DataTypeValidationException(e);
}
}

Discussion

  • Rost Vashevnik

    Rost Vashevnik - 2006-06-26

    Logged In: YES
    user_id=883678

    Hello !

    This message is to notify you that someone from MetaBoss team
    have had a look at your bug report, it was accepted and is
    now awaiting the resolution. This means that someone from the
    MetaBoss team will have a closer look at it and formulate a
    response to you (most likely within 48 hours).

    Please note that in addition to the Sourceforge support facilities
    we maintain a FAQ and Forum at www.metaboss.com. If you have
    not already done so, we suggest that you visit our site and search
    for possible workarounds.

    Please also note that all MetaBoss users are free to use any
    support channel they like, however, in order to enjoy VIP Support,
    MetaBoss Commercial License Holders must submit their questions
    to the Forum at www.metaboss.com.

    Thank you for your contribution to MetaBoss

    MetaBoss team

     
  • Rost Vashevnik

    Rost Vashevnik - 2006-06-26
    • assigned_to: nobody --> metaboss
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.