Skip to content

Commit

Permalink
Renamed metre to meter
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrehsaad committed Mar 17, 2024
1 parent 0d5574b commit 027da7c
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions Sources/Measures/Documentation.docc/Articles/Demonstration.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i
let constant: Double
let symbol: String
static let base: Self = .kilometresPerLiter
static let base: Self = .kilometersPerLiter
}
```

2. Create a minimum of two units.

```swift
extension FuelEfficiency {
static let kilometresPerLiter: Self = .init(
static let kilometersPerLiter: Self = .init(
coefficient: Length.kilometer.coefficient / Volume.liter.coefficient,
symbol: "Km/L"
)

static let metresPerLiter: Self = .init(
static let metersPerLiter: Self = .init(
coefficient: Length.meter.coefficient / Volume.liter.coefficient,
symbol: "m/L"
)
Expand All @@ -49,13 +49,13 @@ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i
3. Initialize a measure of your dimension with a value and unit.

```swift
var measure: Measure<FuelEfficiency> = .init(5, .kilometresPerLiter)
var measure: Measure<FuelEfficiency> = .init(5, .kilometersPerLiter)
```

4. Convert the measure to your other unit.

```swift
measure.convert(to: .metresPerLiter)
measure.convert(to: .metersPerLiter)

print(measure)
// Prints "5000m/L"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

### Composed Units

- ``metrePerSquareSecond``
- ``meterPerSquareSecond``
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

### Metric Units

- ``kilometresPerHour``
- ``metresPerSecond``
- ``kilometersPerHour``
- ``metersPerSecond``

### Other Units

Expand Down
4 changes: 2 additions & 2 deletions Sources/Measures/Types/Measure/Measure+Equivalentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ extension Measure: Equivalentable {
///
/// ```swift
/// let oneMeter: Measure<Length> = .init(1, .meter)
/// let oneHundredCentimetres: Measure<Length> = .init(100, .centimeter)
/// print(oneMeter.isEquivalent(to: oneHundredCentimetres))
/// let oneHundredCentimeters: Measure<Length> = .init(100, .centimeter)
/// print(oneMeter.isEquivalent(to: oneHundredCentimeters))
/// // Prints "true"
/// ```
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ extension Acceleration {
// MARK: - Composed Units

/// The meter per square second unit of acceleration.
public static let metrePerSquareSecond: Self = Length.meter.dividing(by: .second)
public static let meterPerSquareSecond: Self = Length.meter.dividing(by: .second)
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ public struct Acceleration: Measurable {

// MARK: - Base Unit

public static let base: Self = .metrePerSquareSecond
public static let base: Self = .meterPerSquareSecond
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ extension Speed {

// MARK: - Metric Units

/// The kilometres per hour unit of speed.
public static let kilometresPerHour: Self = Length.kilometer.dividing(by: .hour)
/// The kilometers per hour unit of speed.
public static let kilometersPerHour: Self = Length.kilometer.dividing(by: .hour)

/// The meter per second unit of speed.
public static let metresPerSecond: Self = Length.meter.dividing(by: .second)
public static let metersPerSecond: Self = Length.meter.dividing(by: .second)

// MARK: - Other Units

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ public struct Speed: Measurable {

// MARK: - Base Unit

public static let base: Self = .metresPerSecond
public static let base: Self = .metersPerSecond
}

0 comments on commit 027da7c

Please sign in to comment.