Пример #1
0
 public static string Stringify(string format, decimal amount)
 {
     try
     {
         StringifiableFormatInfo provider = new StringifiableFormatInfo();
         string fmt = "{0:" + format + "}";
         return(string.Format(provider, fmt, amount));
     }
     catch (Exception ex)
     {
         return(string.Format("Exception: {0}", ex.Message));
     }
 }
Пример #2
0
 public static string AmountToLettersPercent(decimal amount, string lang, bool showPercent)
 {
     try
     {
         StringifiableFormatInfo provider = new StringifiableFormatInfo();
         string fmt = "{0:D" + (showPercent ? "%" : "") + "[" + lang + "]}";
         return(string.Format(provider, fmt, amount));
     }
     catch (Exception e)
     {
         return(string.Format("Exception: {0}", e.Message));
     }
 }
Пример #3
0
 public static string AmountToLetters(decimal amount, string lang)
 {
     try
     {
         StringifiableFormatInfo provider = new StringifiableFormatInfo();
         string fmt = "{0:D[" + lang + "]}";
         return(string.Format(provider, fmt, Convert.ToDecimal(amount)));
     }
     catch (Exception e)
     {
         return(string.Format("Exception: {0}", e.Message));
     }
 }
Пример #4
0
 //[SqlFunction(DataAccess = DataAccessKind.Read, IsDeterministic = true, Name = "Stringify")]
 public static string Stringify(string format, decimal amount)
 {
     try
     {
         StringifiableFormatInfo provider = new StringifiableFormatInfo();
         string fmt = "{0:" + format + "}";
         return string.Format(provider, fmt, amount);
     }
     catch (Exception ex)
     {
         return string.Format("Exception: {0}", ex.Message);
     }
 }
Пример #5
0
 //[SqlFunction(DataAccess = DataAccessKind.Read, IsDeterministic = true, Name = "AmountToLettersPercent")]
 public static string AmountToLettersPercent(decimal amount, string lang, bool showPercent)
 {
     try
     {
         StringifiableFormatInfo provider = new StringifiableFormatInfo();
         string fmt = "{0:D" + (showPercent ? "%" : "") + "[" + lang + "]}";
         return string.Format(provider, fmt, amount);
     }
     catch (Exception e)
     {
         return string.Format("Exception: {0}", e.Message);
     }
 }
Пример #6
0
 //[SqlFunction(DataAccess = DataAccessKind.Read, IsDeterministic = true, Name = "AmountToLetters")]
 public static string AmountToLetters(decimal amount, string lang)
 {
     try
     {
         StringifiableFormatInfo provider = new StringifiableFormatInfo();
         string fmt = "{0:D[" + lang + "]}";
         return string.Format(provider, fmt, Convert.ToDecimal(amount));
     }
     catch (Exception e)
     {
         return string.Format("Exception: {0}", e.Message);
     }
 }