api รายงานประกาศเกษียณลูกจ้างประจำ
This commit is contained in:
parent
9abb9c5422
commit
81b2ad210b
5 changed files with 211 additions and 29 deletions
|
|
@ -1,3 +1,5 @@
|
|||
using System.Text;
|
||||
|
||||
namespace BMA.EHR.Domain.Extensions
|
||||
{
|
||||
public static class IntegerExtension
|
||||
|
|
@ -40,5 +42,25 @@ namespace BMA.EHR.Domain.Extensions
|
|||
{
|
||||
return number.ToString("#,##0");
|
||||
}
|
||||
|
||||
public static string ToThaiNumber(this string value)
|
||||
{
|
||||
string arabicNumbers = "0123456789";
|
||||
string thaiNumbers = "๐๑๒๓๔๕๖๗๘๙";
|
||||
StringBuilder ThaiYear = new StringBuilder();
|
||||
foreach (char digit in value)
|
||||
{
|
||||
int index = arabicNumbers.IndexOf(digit);
|
||||
if (index >= 0)
|
||||
{
|
||||
ThaiYear.Append(thaiNumbers[index]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ThaiYear.Append(digit);
|
||||
}
|
||||
}
|
||||
return ThaiYear.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue