Skip to content

Commit

Permalink
1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabute committed Sep 11, 2020
1 parent 6e95e61 commit ffa92e2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "abushakir",
"version": "1.2.0",
"version": "1.2.1",
"description": "Ethiopian Datetime and Calendar Reckoning system. COMPUTUS.",
"main": "lib/index.js",
"type": "lib/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/example/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ const allFastings = bh.allAtswamat; // => List of All fasting and Movable holida
* Arabic or English number (1,2,3...) to Ethiopic or GE'EZ number Convertor
*/

const testNums: number[] = [1, 10, 15, 20, 25, 78, 105, 333, 450, 600, 1000, 1001, 1010, 1056, 1200, 2013, 9999, 10000]
const testNums: number[] = [1, 10, 15, 20, 25, 78, 105, 333, 450, 600, 1000, 1001, 1010, 1056, 1200, 2013, 9999, 10000];

for (const num of testNums) {
// console.log(ConvertToEthiopic(num)); // [፩, ፲, ፲፭, ፳, ፳፭, ፸፰, ፻፭, ፫፻፴፫, ፬፻፶, ፮፻, ፲፻, ፲፻፩, ፲፻፲, ፲፻፶፮, ፲፪፻, ፳፻፲፫, ፺፱፻፺፱, ፻፻]
// console.log(ConvertToEthiopic(num)); // [፩, ፲, ፲፭, ፳, ፳፭, ፸፰, ፻፭, ፫፻፴፫, ፬፻፶, ፮፻, ፲፻, ፲፻፩, ፲፻፲, ፲፻፶፮, ፲፪፻, ፳፻፲፫, ፺፱፻፺፱, ፻፻]
}
6 changes: 4 additions & 2 deletions src/utils/numberConvertor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ function convert_101_2_1000_to_ethiopic(num: number) {
if (result[1] === 0) {
return `${ethiopicNumber[result[0]]}${ethiopicNumber[100]}`;
}
const left: string = result[0] === 1 ? `${ethiopicNumber[100]}` : `${ethiopicNumber[result[0]]}${ethiopicNumber[100]}`;
const left: string =
result[0] === 1 ? `${ethiopicNumber[100]}` : `${ethiopicNumber[result[0]]}${ethiopicNumber[100]}`;

const right: string = result[1] <= 10 ? convert_1_2_10_to_ethiopic(result[1]) : convert_11_2_100_to_ethiopic(result[1]);
const right: string =
result[1] <= 10 ? convert_1_2_10_to_ethiopic(result[1]) : convert_11_2_100_to_ethiopic(result[1]);

return `${left}${right}`;
}
Expand Down

0 comments on commit ffa92e2

Please sign in to comment.