Rounded quantities on report
  • Julie Macreadie
    Rounded quantities on report

    by Julie Macreadie » Mon Jan 16, 2006 10:25 am

    I was wondering how difficult it would be to write a script (I am fairly sure I need a script) that will print Stock Quantities in a Visual Builder report in whole figures even though they are stored as 2 decimals in Capital? I need to make an adjustment to a report we wrote for Lion Nathan.
  • COBS Tech Support
    Posts:683
    Joined:Fri Sep 09, 2005 8:23 am

    by COBS Tech Support » Mon Jan 16, 2006 10:35 am

    Double-click on the field object you want to alter and change "Decimal Places" from "2" to "0". This should round the quantity displayed to the nearest whole number.
  • Guest

    by Guest » Mon Jan 16, 2006 1:36 pm

    This doesn't work for me. But maybe it's because I have a script here. This is the script inside this field:

    Declare XAvalab Type Numeric
    XAvalab := AsVal(Stock->Stock_In) - AsVal(Stock->Allocated)
    Return AsChar(XAvalab)
  • COBS Tech Support
    Posts:683
    Joined:Fri Sep 09, 2005 8:23 am

    by COBS Tech Support » Mon Jan 16, 2006 1:38 pm

    Please change the last line of your script to read:

    Return XAvalab

    This is because you are returing a character string, not a number. Rounding settings are ignored unless your script returns a numeric value.

Who is online

Users browsing this forum: No registered users and 25 guests