Sage 100

 View Only
  • 1.  Does anyone know how to format (in Crystal) a numb

    Posted 03-09-2016 14:45
    Does anyone know how to format (in Crystal) a number so as to drop the insignificant zeros in the decimal? The client has Six Decimal Precision and wants to show only the digits that matter. Some items use 6 decimals places but others use only 2. They do not want the 2 decimal prices to show the 4 additional zeros at the end. ie $1.990000.


  • 2.  RE: Does anyone know how to format (in Crystal) a numb

    Posted 03-09-2016 14:49
    In Excel, we just use the General Format and hope no number has three hundred decimal places! Is there such a thing in CR?


  • 3.  RE: Does anyone know how to format (in Crystal) a numb

    Posted 03-09-2016 15:05
      |   view attached
    Try using a custom format.


  • 4.  RE: Does anyone know how to format (in Crystal) a numb

    Posted 03-09-2016 17:32
    @DougHiggs suggestion will work as long as the precision is not controlled by a formula.


  • 5.  RE: Does anyone know how to format (in Crystal) a numb

    Posted 03-09-2016 18:56
    @DougHiggs I didn't explain that very well. a custom format does not work because it formats all numbers the same. Let me give some examples to better illustrate. In common information; price is set to **6 decimals**. Item1 has a price of $1.99 Item 2 has a price of $0.0055 On the order (and on the Item Maint screen for that matter) each of item displays as follows: Item1 shows $1.990000 Item2 shows $0.005500 What they want is to format these dynamically. Item1 should display $1.99 Item2 should display $0.0055 Each item requires a different mask based on the non zero digits at the end.


  • 6.  RE: Does anyone know how to format (in Crystal) a numb

    Posted 03-09-2016 23:55
    You can create a formula. It should look something like this: local NumberVar n := {SO_SalesOrderWrk.UnitPrice}; NumberVar Zeros; StringVar Frctn; Frctn := ToText (n - (Truncate (n)), 6); if Frctn[8] <> ""0"" then Zeros := 6 else if Frctn[7] <> ""0"" then Zeros := 5 else if Frctn[6] <> ""0"" then Zeros := 4 else if Frctn[5] <> ""0"" then Zeros := 3 else if Frctn[4] <> ""0"" then Zeros := 2 else if Frctn[3] <> ""0"" then Zeros := 1 else Zeros := 0; if Zeros>2 then totext(n,Zeros) else totext(n,2)


  • 7.  RE: Does anyone know how to format (in Crystal) a numb

    Posted 03-10-2016 09:45
    I also found this googling: numbervar dec := 6; numbervar i; numbervar j := dec + 1; numbervar x; for i := 1 to j do ( if val(right(totext(currentfieldvalue,j,""""),i)) = 0 then x := j - i); x Will try both later today thanks @DougHiggs


  • 8.  RE: Does anyone know how to format (in Crystal) a numb

    Posted 03-10-2016 10:05
    Mine uses ""If, then , else"" logic. Yours uses a ""for, do loop"". Looks like they should both work. Good luck.


  • 9.  RE: Does anyone know how to format (in Crystal) a numb

    Posted 03-10-2016 10:24
    Will test both for sure.


  • 10.  RE: Does anyone know how to format (in Crystal) a numb

    Posted 03-12-2016 09:38
    Appreciate everyone's help. FWIW - This is the formula that I ended up using: numbervar dec := 6; //6 is the maximum decimals with DSD 6 Decimal Precision numbervar i; numbervar j := dec + 1; numbervar k := 2; //minimum decimals to display numbervar x; for i := 1 to j - k do ( if val(right(totext(currentfieldvalue,j,""""),i)) = 0 then x := j - i); x In rounding formula: numbevar dec;