Exemplo n.º 1
0
        protected static string FormatForType(object o, HistogramValueTypes valueType)
        {
            if (o == null)
            {
                return(string.Empty);
            }

            switch (valueType)
            {
            case HistogramValueTypes.Currency:
                return(String.Format(CultureInfo.CurrentCulture, "{0:C}", o));

            case HistogramValueTypes.Decimal:
            case HistogramValueTypes.Time:
                return(String.Format(CultureInfo.CurrentCulture, "{0:#,##0.0#}", o));

            case HistogramValueTypes.Integer:
                return(String.Format(CultureInfo.CurrentCulture, "{0:#,##0}", o));

            default:
                return(o.ToString());
            }
        }
Exemplo n.º 2
0
        public static string FormatForType(object o, HistogramValueTypes valueType, bool fUseHHMM = false, bool fIncludeZero = true)
        {
            if (o == null)
            {
                return(string.Empty);
            }

            switch (valueType)
            {
            case HistogramValueTypes.Currency:
                return(String.Format(CultureInfo.CurrentCulture, "{0:C}", o));

            case HistogramValueTypes.Decimal:
            case HistogramValueTypes.Time:
                return(o.FormatDecimal(fUseHHMM, fIncludeZero));

            case HistogramValueTypes.Integer:
                return(String.Format(CultureInfo.CurrentCulture, "{0:#,##0}", o));

            default:
                return(o.ToString());
            }
        }
Exemplo n.º 3
0
 public HistogramableValue(string fieldName, string displayName, HistogramValueTypes dataType)
 {
     DataField = fieldName;
     DataName  = displayName;
     DataType  = dataType;
 }