Ejemplo n.º 1
0
        /// <summary>
        /// Print Money class object, ex. $1,334.30042 $12.003
        /// </summary>
        public override string ToString()
        {
            string output = CurrencyExchangeHelper.TryCalculate(amount).ToStringGlobal();

            if (AppSettings.Site.CommasInNumbersEnabled)
            {
                String formatCommand = "{0:n" + CoreSettings.GetMaxDecimalPlaces(CurrencyType.Fiat) + "}";
                output = String.Format(new System.Globalization.CultureInfo("en-US"), formatCommand, Decimal.Parse(output));
            }

            //Show zeros?
            if (!AppSettings.Site.ShowRemainingZeros)
            {
                output = CutEndingZeros(output);
            }

            output = AddCurrencySign(output);

            return(output);
        }
Ejemplo n.º 2
0
 public Money ToMulticurrency()
 {
     return(CurrencyExchangeHelper.TryCalculate(this));
 }