Search:

Type: Posts; User: juanp_1982

Search: Search took 0.15 seconds.

  1. [SOLVED] Re: I don't know why this error using get() method from the ArrayList class

    Hi! thanks for answering!


    I'm SO sorry!!!!!!! my bad!!! I wrote ProgrammerS instead of Programmer now the code works fine without any error!! thanks so much!!! both of you
  2. [SOLVED] Re: I don't know why this error using get() method from the ArrayList class

    hi there!

    How do i do that??? because If I type what you wrote I get a syntax error
  3. [SOLVED] I don't know why this error using get() method from the ArrayList class

    Hi Every body!

    I'm trying to store (momently) each element of a ArrayList in a Programmer object variable to use one of its method, but I'm getting and and error and a warning I don't know neither...
  4. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    I just learned Java doesn't like 0.00, so it change it to 0.0 so the method works just fine
  5. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    ok, thanks very much for trying! :-)
  6. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    it is strange, because I get more desirable results this is the code that I'm using right now


    public double formatMoney(double money) {
    double money_formatted = 0.00;

    if...
  7. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    I used FLOOR, CEILING, UP, DOWN, HALF_UP, HALF_DOWN and all gave me the same result
  8. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    well, I couldn't (or at least I haven't learn) use scale() method, instead I use setscale() method




    public double formatMoney(double money) {
    double money_formatted = 0.00;

    ...
  9. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    I don't see any other method that can help me :-( , I'm using this site
  10. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    round() returns this 1.5E+3.

    I think the error is in this line


    MathContext format = new MathContext(2, RoundingMode.HALF_UP);

    how should I set it? in order to get 1452.79 (only two...
  11. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    it compiles and runs, but doesn't behave I would like to.

    the output that I'm getting is 1500.0 when I introduce 1452.78965412 and I want to get 1452.79,

    what am I doing wrong?
  12. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    I just checked it, it returns a BigDecimal object,

    should this work?(I added another BigDecimal object called formatted_2)


    public double formatMoney(double money) {
    double...
  13. Replies
    21
    Views
    2,372

    [SOLVED] Re: working with BigDecimal and MathContext

    I thought the round method modify "this" BigDecimal object, but I'm not sure if I'm doing it correctly, do you know how I should do it????
  14. Replies
    21
    Views
    2,372

    [SOLVED] working with BigDecimal and MathContext

    Hi Every body!!


    I'm learning java this semester, I have a C/C++ background so sometimes things get a litter bit confusing in here, hopefully I learn the very basis soon :-)


    I'm working with...
Results 1 to 14 of 14