diff --git a/src/Units-Core/NamedUnit.class.st b/src/Units-Core/NamedUnit.class.st index 6713781..61dddcf 100644 --- a/src/Units-Core/NamedUnit.class.st +++ b/src/Units-Core/NamedUnit.class.st @@ -197,7 +197,13 @@ NamedUnit class >> initializeOtherUnits [ name: 'watt' pluralName: 'watts' value: (1 units: ((Unit ampere) * (Unit volt))). - + self + abbreviation: 'dB' + name: 'decibel' + pluralName: 'decibels' + value: ((10 raisedTo: ((1 - 30) / 10)) units: Unit watt). + self flag:'labordep: how to convert this unit to watt because this is not a *?'. + DerivedUnit abbreviation: 'deg' name: 'arcdegree' diff --git a/src/Units-Core/Number.extension.st b/src/Units-Core/Number.extension.st index 4864e5b..7296475 100644 --- a/src/Units-Core/Number.extension.st +++ b/src/Units-Core/Number.extension.st @@ -152,6 +152,18 @@ Number >> cm [ ^self units: #centimeter ] +{ #category : '*Units-Core' } +Number >> dB [ + + ^ self decibel +] + +{ #category : '*Units-Core' } +Number >> decibel [ + + ^ self units: #decibel +] + { #category : '*Units-Core' } Number >> degreeCelsius [ diff --git a/src/Units-Core/Unit.class.st b/src/Units-Core/Unit.class.st index 1e708e1..de97091 100644 --- a/src/Units-Core/Unit.class.st +++ b/src/Units-Core/Unit.class.st @@ -187,6 +187,12 @@ Unit class >> coulombs [ ^self coulomb ] +{ #category : 'power units' } +Unit class >> dB [ + + ^ self decibel +] + { #category : 'time units' } Unit class >> day [ @@ -199,6 +205,12 @@ Unit class >> days [ ^ self day ] +{ #category : 'power units' } +Unit class >> decibel [ + + ^ NamedUnit named: 'decibel' +] + { #category : 'miscellaneous units' } Unit class >> deg [ @@ -595,6 +607,12 @@ Unit class >> micrograms [ ^self microgram ] +{ #category : 'time units' } +Unit class >> microsecond [ + + ^ self microseconds +] + { #category : 'time units' } Unit class >> microseconds [