User defined functions using currency do not work

Discussion in 'Mac Apps and Mac App Store' started by edblanchard, Jun 10, 2013.

  1. edblanchard, Jun 10, 2013
    Last edited: Jun 10, 2013

    edblanchard macrumors newbie

    Jun 10, 2013
    This works on both Mac office 2011 and MS Offcie on a PC
    call with 2 and 3.5 you get 5 ok for integer
    Function Add(Number1 As Integer, Number2 As Integer) As Integer
    Add = Number1 + Number2
    End Function

    This works on MS Office PC but gets a crazy big number on the MAC
    about 18 trillion
    Function Add(Number1 As Currency, Number2 As Currency) As Currency
    Add = Number1 + Number2
    End Function

    Any one have an idea?
    Also it is correct in the debugger until the return. This example is simple. I have very complex functions that do not work under the same conditions.
  2. glenthompson macrumors 68000


    Apr 27, 2011
    I got the same results. If you change the function definition to Add(...) as Double it seems to work ok. The currency data type is a double floating point number.

Share This Page