Skip to content

Commit

Permalink
v0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jianshangquan committed Aug 9, 2022
1 parent 887d056 commit 7e5a6c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
Convert amount in letter

```java
String result = AmountToWord.convertTo( 123456789, AmountConvertion.BURMESE);
String result = AmountToWord.convertTo( 123456789, AmountConversion.BURMESE);
// output => တစ်ထောင်နှစ်ရာသုံးဆယ့်လေးသိန်းငါးသောင်းခြှောက်ထောင်ခုနှစ်ရာရှစ်ဆယ့်ကိုးကျပ်
```
16 changes: 8 additions & 8 deletions src/main/java/AmountToWord.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ protected AmountToWord(){

}

static AmountToWord getConverter(AmountConvertion convertion) throws Exception{
static AmountToWord getConverter(AmountConversion convertion) throws Exception{
switch (convertion){
case BURMESE: {
return new BurmeseAmountToWord();
Expand All @@ -24,24 +24,24 @@ static AmountToWord getConverter(AmountConvertion convertion) throws Exception{
}
}

static AmountToWord getConverter(int amt, AmountConvertion convertion) throws Exception{
static AmountToWord getConverter(int amt, AmountConversion convertion) throws Exception{
return getConverter(convertion).setAmount(amt);
}
static AmountToWord getConverter(double amt, AmountConvertion convertion) throws Exception{
static AmountToWord getConverter(double amt, AmountConversion convertion) throws Exception{
return getConverter(convertion).setAmount(amt);
}
static AmountToWord getConverter(BigDecimal amt, AmountConvertion convertion) throws Exception{
static AmountToWord getConverter(BigDecimal amt, AmountConversion convertion) throws Exception{
return getConverter(convertion).setAmount(amt);
}


static String convertTo(int amt, AmountConvertion convertion) throws Exception{
static String convertTo(int amt, AmountConversion convertion) throws Exception{
return getConverter(convertion).setAmount(amt).convertInLetter();
}
static String convertTo(double amt, AmountConvertion convertion) throws Exception{
static String convertTo(double amt, AmountConversion convertion) throws Exception{
return getConverter(convertion).setAmount(amt).convertInLetter();
}
static String convertTo(BigDecimal amt, AmountConvertion convertion) throws Exception{
static String convertTo(BigDecimal amt, AmountConversion convertion) throws Exception{
return getConverter(convertion).setAmount(amt).convertInLetter();
}

Expand All @@ -62,7 +62,7 @@ AmountToWord setAmount(BigDecimal amt){
abstract String convertInLetter();
}

enum AmountConvertion{
enum AmountConversion {
BURMESE,
CHINESE,
ENGLISH
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/Main.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public class Main {
public static void main(String[] args) throws Exception {
String result = AmountToWord.convertTo( 123456789, AmountConvertion.BURMESE);
String result = AmountToWord.convertTo( 123456789, AmountConversion.BURMESE);
System.out.println(result);
}
}

0 comments on commit 7e5a6c3

Please sign in to comment.