private string GetPrintValue(decimal d) { if (_options == null) { return(HqlCategory.PrintDefaultDecimal(d)); } else { return(d.ToString(_options.DecimalPrintString)); } }
/////////////////////// // Static Functions static public bool MakeAppropriateObjects(ref object v1, ref object v2) { if ( (v1 is Int64 || v1 is Int32 || v1 is string && HqlCategory.IsInt((string)v1)) && (v2 is Int64 || v2 is Int32 || v2 is string && HqlCategory.IsInt((string)v2)) ) { if (v1 is string) { v1 = Int64.Parse(v1.ToString()); } else if (v1 is Int32) { v1 = (Int64)((Int32)v1); } if (v2 is string) { v2 = Int64.Parse(v2.ToString()); } else if (v2 is Int32) { v2 = (Int64)((Int32)v2); } return(true); } else if ( (v1 is decimal || v1 is string && HqlCategory.IsFloat((string)v1)) && (v2 is decimal || v2 is string && HqlCategory.IsFloat((string)v2)) ) { if (v1 is string) { v1 = Decimal.Parse(v1.ToString()); } if (v2 is string) { v2 = Decimal.Parse(v2.ToString()); } return(true); } return(false); }