Skip to content

Commit

Permalink
Add lines-of-code as a unit
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp authored and David Peter committed Aug 21, 2024
1 parent afd3a57 commit d776fb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/list-units.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ and — where sensible — units allow for [binary prefixes](https://en.wikipedi
| `Length` | [Yard](https://en.wikipedia.org/wiki/Yard) | `yard`, `yards`, `yd` |
| `Length / Volume` | [Miles per gallon](https://en.wikipedia.org/wiki/Fuel_economy_in_automobiles) | `mpg` |
| `Length^2` | [darcy](https://en.wikipedia.org/wiki/Darcy_(unit)) | `darcies`, `darcy`, `darcys` |
| `LinesOfCode` | [Lines of code](https://en.wikipedia.org/wiki/Source_lines_of_code) | `LOC`, `SLOC` |
| `LuminousFlux` | [Lumen](https://en.wikipedia.org/wiki/Lumen_(unit)) | `lm`, `lumen`, `lumens` |
| `LuminousIntensity` | [Candela](https://en.wikipedia.org/wiki/Candela) | `candela`, `candelas`, `cd` |
| `MagneticFieldStrength` | [Oersted](https://en.wikipedia.org/wiki/Oersted) | `Oe`, `oersted` |
Expand Down
9 changes: 9 additions & 0 deletions numbat/modules/units/placeholder.nbt
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,12 @@ dimension Person
@name("Person")
@aliases(persons, people, capita)
unit person: Person

# A unit for counting lines of code
dimension LinesOfCode

@name("Lines of code")
@url("https://en.wikipedia.org/wiki/Source_lines_of_code")
@metric_prefixes
@aliases(LOC: short, SLOC: short)
unit LOC: LinesOfCode

0 comments on commit d776fb0

Please sign in to comment.