We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d83c72f + 2b1e648 commit e2d98caCopy full SHA for e2d98ca
src/index.test.ts
@@ -68,4 +68,7 @@ it('works', () => {
68
expect(numericQuantity('2 \u2155')).toBe(2.2); // 2 1/5
69
// Mixed unicode vulgar fraction - no space
70
expect(numericQuantity('2\u2155')).toBe(2.2); // 2 1/5
71
+ // Unicode fraction slash
72
+ expect(numericQuantity('1⁄2')).toBe(0.5);
73
+ expect(numericQuantity('2 1⁄2')).toBe(2.5);
74
});
src/index.ts
@@ -35,6 +35,7 @@ function numericQuantity(qty: string) {
35
vulgarFractionsRegex,
36
(_m, vf: keyof typeof VulgarFraction) => ` ${VulgarFraction[vf]}`
37
)
38
+ .replace(/⁄/g, '/')
39
.trim();
40
41
/**
0 commit comments