negative calculations

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default negative calculations

    Not sure if this is within CF or MySQL, but I have a item with I want to
    multiply quantity by a negative dollar value. The number and amount are both
    prepopulated from a MySQL database. It seems to not calculate the negative
    number and resets it to 0 on the display page after the calculation is done.
    The database save the quantity as a negative ok, but not the dollar value.

    Any advice?

    sjhf Guest

  2. Similar Questions and Discussions

    1. Calculations in datagrid
      Hi Aparna, It would be helpful if u provide some sample code. regards, kchalla "aparna reddy via .NET 247" wrote:
    2. PDF Forms - Calculations
      I'm trying to develop a PDF form that serves as a timecard. I want to be able to subtract a time formatted text field in order to get a total hours...
    3. Calculations with date
      Hello all, I am looking for an advice or suggestion in this task: I do have a Perl script which contains 2 variables ($low, $high). The value...
    4. Doing time calculations...
      Howdy, For a project I am working on right now I need to be able to calculate the time difference between to given times. (For example...The...
    5. calculations and tables
      I'm relatively new to Access, and I'm in the process of creating a few simple databases to manage our inventory. This database is going to involve...
  3. #2

    Default negative calculations

    Not sure if this is within CF or MySQL, but I have a item with I want to
    multiply quantity by a negative dollar value. The number and amount are both
    prepopulated from a MySQL database. It seems to not calculate the negative
    number and resets it to 0 on the display page after the calculation is done.
    The database save the quantity as a negative ok, but not the dollar value.

    Any advice?

    sjhf Guest

  4. #3

    Default Re: negative calculations

    a negative should be possible if a negative is actually coming from the DB data

    try outputting the initial data to see what it shows, or even look in the data
    tables themseleves to see if the field is allowing negative values.

    are you sure the output isn't just showing up as ($23.99) - brackets do
    indicate negative values.



    SafariTECH Guest

  5. #4

    Default Re: negative calculations

    Yep. I checked the database and it was. I was wondering if there was anything
    special to do with DollarFormat. It's at the point it tries to calculate that
    it calculates at 0. All positive number calculations are fine.

    sjhf Guest

  6. #5

    Default Re: negative calculations

    What do you see if you simply use #ExtraTotal# instead of DollarFormatting it?
    does it show a negative decimal number?

    If you use #DollarFormat("-23.99")# you should get (23.99) which is negative.
    Therefore outputing the variable in dollarformat should do the same.



    SafariTECH Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139