Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/type/unit/Unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1837,9 +1837,9 @@ export const createUnitClass = /* #__PURE__ */ factory(name, dependencies, ({
name: 'acre',
base: BASE_UNITS.SURFACE,
prefixes: PREFIXES.NONE,
value: 4046.86,
value: 4046.8564224,
offset: 0
}, // 4046.86 m2
}, // 4046.8564224 m2 (4840 sqyd)
hectare: {
name: 'hectare',
base: BASE_UNITS.SURFACE,
Expand Down
5 changes: 5 additions & 0 deletions test/unit-tests/type/unit/Unit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,11 @@ describe('Unit', function () {
assert.strictEqual(new Unit(1, 'kilogramforce').equals(new Unit(1, 'kgf')), true)
})

it('should define acre exactly as 4840 sqyd', function () {
assert.strictEqual(new Unit(1, 'acre').equals(new Unit(4840, 'sqyd')), true)
assert.strictEqual(new Unit(1, 'acre').equals(new Unit(43560, 'sqft')), true)
})

it("For each built-in unit, 'name' should match key", function () {
for (const key in Unit.UNITS) {
if (hasOwnProperty(Unit.UNITS, key)) {
Expand Down