Skip to content

Commit

Permalink
Fix typos (#39)
Browse files Browse the repository at this point in the history
Co-authored-by: Dennis Geldhof <[email protected]>
  • Loading branch information
denxorz and DennisNurtio authored Aug 18, 2023
1 parent afba47b commit dfffa5f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/new_unit_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''
---

**Description**
Add here a brief explanation to which units should be added and possibily why (e.g. they are often used in a specific job). We know that there are a ton of unit of measurement that are not yet added to this app. We want to have just the most used one.
Add here a brief explanation to which units should be added and possibly why (e.g. they are often used in a specific job). We know that there are a ton of unit of measurement that are not yet added to this app. We want to have just the most used one.

**Units to be added**
| Unit name | Property | Reference to the conversion formula |
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ documentation for more details. Now you can easily convert in this way:

# 1.2.0
Improved the formatting of the string representation of the number
(`stringValue`): now it is also possibile to choose between decimal or
(`stringValue`): now it is also possible to choose between decimal or
scientific notation. Added feet (US survey), feet squared (US survey) and
kilocalories.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

This package is used by [Converter NOW](https://github.com/ferraridamiano/ConverterNOW)!

The documentation is structured in examples of incresing complexity. But don't worry, in most cases you will only need the first examples.
The documentation is structured in examples of increasing complexity. But don't worry, in most cases you will only need the first examples.

## Table of Contents
- [Convert a unit to another unit (the easy way)](#convert-a-unit-to-another-unit-the-easy-way)
Expand Down Expand Up @@ -153,7 +153,7 @@ Output:

## Custom conversion

*In most cases, you will only need `SimpleCustomProperty` (see the previous section). `SimpleCustomProperty` allow you to define conversions in the form of `y=ax`. But if you need to define special relationship between units you need `CustomProperty`. This allow you to perform conversion like: `y=ax+b` and `y=a/x+b` (where `y` and x are the value of two units and `a` and `b` are two coefficient), for example the conversion between Celsius and Fahreneit use the first relation and the conversion between km/l and l/100km has to be done with the second relation. Both can't be done with `SimpleCustomProperty`.*
*In most cases, you will only need `SimpleCustomProperty` (see the previous section). `SimpleCustomProperty` allow you to define conversions in the form of `y=ax`. But if you need to define special relationship between units you need `CustomProperty`. This allow you to perform conversion like: `y=ax+b` and `y=a/x+b` (where `y` and x are the value of two units and `a` and `b` are two coefficient), for example the conversion between Celsius and Fahrenheit use the first relation and the conversion between km/l and l/100km has to be done with the second relation. Both can't be done with `SimpleCustomProperty`.*

**Example 6**: let's define the following imaginary units of measurement:

Expand Down Expand Up @@ -228,7 +228,7 @@ name:OneOver(DashPlus1), value:0.5, stringValue:0.5, symbol:null

- Speed (miles per hour, kilometers per hour, etc.)

- Temperature (celsius, fahreneit, etc.)
- Temperature (celsius, fahrenheit, etc.)

- Time (seconds, years, etc.)

Expand Down
2 changes: 1 addition & 1 deletion example/example3.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ void main() {
Angle(significantFigures: 7, removeTrailingZeros: false); // conversion
angle.convert(ANGLE.degree, 1);
// We get all the units
var units = angle.getAll(); //We get all ther others units
var units = angle.getAll(); //We get all the others units
// Let's print all of them
for (var unit in units) {
print(
Expand Down
8 changes: 4 additions & 4 deletions example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ void main() {

//example 2: convert 1 meter in inches
var length = Length()..convert(LENGTH.meters, 1); //We give 1 meter as input
var unit = length.inches; //We get all ther others units
var unit = length.inches; //We get all the others units
print(
'name:${unit.name}, value:${unit.value}, stringValue:${unit.stringValue}, symbol:${unit.symbol}');

//----------------------------------------------------------------------------

//example 3: convert 1 degree in all ther other angle units
//example 3: convert 1 degree in all the other angle units
var angle = Angle(
significantFigures: 7,
removeTrailingZeros:
false); //this time let's also keep 7 significant figures
angle.convert(ANGLE.degree, 1); //We give 1 meter as input
var units = angle.getAll(); //We get all ther others units
var units = angle.getAll(); //We get all the others units
for (var unit in units) {
//Let's print them
print(
Expand All @@ -40,7 +40,7 @@ void main() {
'Binary: ${numeralSystems.binary.stringValue}'); //We get the binary value
print(
'Hexadecimal: ${numeralSystems.hexadecimal.stringValue}'); //We get the hexadecimal value
//Warning! Numeral systems conversion is the only conversion that need the input as a string, and not as a double/int for obvous reasons
//Warning! Numeral systems conversion is the only conversion that need the input as a string, and not as a double/int for obvious reasons

//----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion lib/models/double_property.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract class DoubleProperty<T> extends Property<T, double> {
/// Map between units and its symbol
Map<T, String>? mapSymbols;

/// The number of significan figures to keep. E.g. 1.23456789) has 9
/// The number of significant figures to keep. E.g. 1.23456789) has 9
/// significant figures
int significantFigures;

Expand Down
2 changes: 1 addition & 1 deletion lib/models/ratio_property.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ abstract class RatioProperty<T extends Enum, N, D> extends Property<T, double> {
/// Map between units and its symbol, must be of the same size of T
Map<T, String?> mapSymbols;

/// The number of significan figures to keep. E.g. 1.23456789) has 9
/// The number of significant figures to keep. E.g. 1.23456789) has 9
/// significant figures
int significantFigures;

Expand Down
2 changes: 1 addition & 1 deletion lib/utils/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Property? getPropertyFromEnum(dynamic propertyEnum) {
}
}

/// Given a double value it returns its rapresentation as a string with few
/// Given a double value it returns its representation as a string with few
/// tweaks: [significantFigures] is the number of significant figures to keep,
/// [removeTrailingZeros] say if non important zeros should be removed.
/// E.g. 1.000000 --> 1
Expand Down
2 changes: 1 addition & 1 deletion test/conversion_test.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:test/test.dart';
import 'package:units_converter/units_converter.dart';

/// This function defines if a value is accettable. e.g. if we expect to have 1 but we get 1.00000000012, is this a valid result or not?
/// This function defines if a value is acceptable. e.g. if we expect to have 1 but we get 1.00000000012, is this a valid result or not?
/// The term sensibility is used improperly.
bool isAcceptable(double? convertedValue, double? expectedValue, sensibility) {
if ((convertedValue == null && expectedValue != null) ||
Expand Down

0 comments on commit dfffa5f

Please sign in to comment.