]> granicus.if.org Git - icu/commitdiff
Adapt units.txt format to commit 83e66b7dde
authorHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Fri, 17 Jan 2020 15:21:55 +0000 (16:21 +0100)
committerHugo van der Merwe <17109322+hugovdm@users.noreply.github.com>
Fri, 17 Jan 2020 15:21:55 +0000 (16:21 +0100)
icu4c/source/data/misc/units.txt
tools/cldr/cldr-to-icu/src/main/resources/ldml2icu_supplemental.txt

index 6af2dcd024ff72e5dd1a16dcc2679ead2779df85..6e4ba5daa50c8fdf91a202d677e66df103148481 100644 (file)
 units:table(nofallback){
     cldrVersion{"36.1"}
     convertUnits{
-        1{
-            one{
-                factor{"1"}
-            }
-        }
-        bit{
-            byte{
-                factor{"8"}
-            }
-        }
-        celsius{
-            fahrenheit{
-                factor{"5/9"}
-                offset{"-160/9"}
-            }
-            kelvin{
-                factor{"1"}
-                offset{"273.15"}
-            }
-        }
-        cubic-meter{
-            acre-foot{
-                factor{"ft2m^3 * 43560"}
-            }
-            barrel{
-                factor{"cup2m3 * 672"}
-            }
-            bushel{
-                factor{"0.03523907"}
-            }
-            cup{
-                factor{"cup2m3"}
-            }
-            cup-metric{
-                factor{"0.00025"}
-            }
-            fluid-ounce{
-                factor{"cup2m3/8"}
-            }
-            fluid-ounce-imperial{
-                factor{"0.00002841306"}
-            }
-            gallon{
-                factor{"cup2m3*16"}
-            }
-            gallon-imperial{
-                factor{"0.00454609"}
-            }
-            liter{
-                factor{"0.001"}
-            }
-            pint{
-                factor{"cup2m3 * 2"}
-            }
-            pint-metric{
-                factor{"0.0005"}
-            }
-            quart{
-                factor{"cup2m3 * 4"}
-            }
-            tablespoon{
-                factor{"cup2m3/16"}
-            }
-            teaspoon{
-                factor{"cup2m3/48"}
-            }
-        }
-        degree{
-            arc-minute{
-                factor{"1/60"}
-            }
-            arc-second{
-                factor{"1/360"}
-            }
-            radian{
-                factor{"180/PI"}
-            }
-            revolution{
-                factor{"360"}
-            }
-        }
-        kilogram{
-            carat{
-                factor{"0.0002"}
-            }
-            gram{
-                factor{"0.001"}
-            }
-            metric-ton{
-                factor{"1000"}
-            }
-            ounce{
-                factor{"lb2kg/16"}
-            }
-            ounce-troy{
-                factor{"0.03110348"}
-            }
-            pound{
-                factor{"lb2kg"}
-            }
-            stone{
-                factor{"lb2kg*14"}
-            }
-            ton{
-                factor{"lb2kg*2000"}
-            }
-        }
-        kilogram-meter-per-square-second{
-            newton{
-                factor{"1"}
-            }
-            pound-force{
-                factor{"lb2kg * gravity"}
-            }
-        }
-        kilogram-per-meter-square-second{
-            atmosphere{
-                factor{"101325"}
-            }
-            bar{
-                factor{"100000"}
-            }
-            inch-hg{
-                factor{"3386.389"}
-            }
-            pascal{
-                factor{"1"}
-            }
-        }
-        kilogram-square-meter-per-cubic-second{
-            watt{
-                factor{"1"}
-            }
-        }
-        kilogram-square-meter-per-cubic-second-ampere{
-            volt{
-                factor{"1"}
-            }
-        }
-        kilogram-square-meter-per-cubic-second-square-ampere{
-            ohm{
-                factor{"1"}
-            }
-        }
-        kilogram-square-meter-per-square-second{
-            calorie{
-                factor{"4.184"}
-            }
-            electronvolt{
-                factor{"1.602177E-19"}
-            }
-            foodcalorie{
-                factor{"4184"}
-            }
-            joule{
-                factor{"1"}
-            }
-            therm-us{
-                factor{"105506000"}
-            }
-        }
-        liter-per-kilometer{
-            mile-per-gallon{
-                factor{"235.215"}
-                reciprocal{"TRUE"}
-            }
-        }
-        meter{
-            astronomical-unit{
-                factor{"149597900000"}
-            }
-            centimeter{
-                factor{"1/100"}
-            }
-            fathom{
-                factor{"f2m * 6"}
-            }
-            foot{
-                factor{"f2m"}
-            }
-            furlong{
-                factor{"f2m*660"}
-            }
-            inch{
-                factor{"f2m/12"}
-            }
-            light-year{
-                factor{"9460730000000000"}
-            }
-            mile{
-                factor{"f2m*5280"}
-            }
-            mile-scandinavian{
-                factor{"10000"}
-            }
-            nautical-mile{
-                factor{"1852"}
-            }
-            parsec{
-                factor{"30856780000000000"}
-            }
-            yard{
-                factor{"f2m*3"}
-            }
-        }
-        meter-per-second{
-            knot{
-                factor{"1852/3600"}
-            }
-        }
-        meter-per-square-second{
-            g-force{
-                factor{"gravity"}
-            }
+        acre{
+            factor{"f2m^2 * 43560"}
+            target{"square-meter"}
+        }
+        acre-foot{
+            factor{"ft2m^3 * 43560"}
+            target{"cubic-meter"}
+        }
+        arc-minute{
+            factor{"1/60"}
+            target{"degree"}
+        }
+        arc-second{
+            factor{"1/360"}
+            target{"degree"}
+        }
+        astronomical-unit{
+            factor{"149597900000"}
+            target{"meter"}
+        }
+        atmosphere{
+            factor{"101325"}
+            target{"kilogram-per-meter-square-second"}
+        }
+        bar{
+            factor{"100000"}
+            target{"kilogram-per-meter-square-second"}
+        }
+        barrel{
+            factor{"cup2m3 * 672"}
+            target{"cubic-meter"}
+        }
+        bushel{
+            factor{"0.03523907"}
+            target{"cubic-meter"}
+        }
+        byte{
+            factor{"8"}
+            target{"bit"}
+        }
+        calorie{
+            factor{"4.184"}
+            target{"kilogram-square-meter-per-square-second"}
+        }
+        carat{
+            factor{"0.0002"}
+            target{"kilogram"}
+        }
+        centimeter{
+            factor{"1/100"}
+            target{"meter"}
+        }
+        cup{
+            factor{"cup2m3"}
+            target{"cubic-meter"}
+        }
+        cup-metric{
+            factor{"0.00025"}
+            target{"cubic-meter"}
+        }
+        day{
+            factor{"86400"}
+            target{"second"}
+        }
+        day-person{
+            factor{"86400"}
+            target{"second"}
+        }
+        dunam{
+            factor{"1000"}
+            target{"square-meter"}
+        }
+        electronvolt{
+            factor{"1.602177E-19"}
+            target{"kilogram-square-meter-per-square-second"}
+        }
+        fahrenheit{
+            factor{"5/9"}
+            offset{"-160/9"}
+            target{"celsius"}
+        }
+        fathom{
+            factor{"f2m * 6"}
+            target{"meter"}
+        }
+        fluid-ounce{
+            factor{"cup2m3/8"}
+            target{"cubic-meter"}
+        }
+        fluid-ounce-imperial{
+            factor{"0.00002841306"}
+            target{"cubic-meter"}
+        }
+        foodcalorie{
+            factor{"4184"}
+            target{"kilogram-square-meter-per-square-second"}
+        }
+        foot{
+            factor{"f2m"}
+            target{"meter"}
+        }
+        furlong{
+            factor{"f2m*660"}
+            target{"meter"}
+        }
+        g-force{
+            factor{"gravity"}
+            target{"meter-per-square-second"}
+        }
+        gallon{
+            factor{"cup2m3*16"}
+            target{"cubic-meter"}
+        }
+        gallon-imperial{
+            factor{"0.00454609"}
+            target{"cubic-meter"}
+        }
+        gram{
+            factor{"0.001"}
+            target{"kilogram"}
+        }
+        hectare{
+            factor{"10000"}
+            target{"square-meter"}
+        }
+        hertz{
+            factor{"1"}
+            target{"one-per-second"}
+        }
+        horsepower{
+            factor{"ft2m * lb2kg * gravity * 550"}
+            target{"square-meter-kilogram-per-cubic-second"}
+        }
+        hour{
+            factor{"3600"}
+            target{"second"}
+        }
+        inch{
+            factor{"f2m/12"}
+            target{"meter"}
+        }
+        inch-hg{
+            factor{"3386.389"}
+            target{"kilogram-per-meter-square-second"}
+        }
+        joule{
+            factor{"1"}
+            target{"kilogram-square-meter-per-square-second"}
+        }
+        karat{
+            factor{"1/24"}
+            target{"one-per-one"}
+        }
+        kelvin{
+            factor{"1"}
+            offset{"273.15"}
+            target{"celsius"}
+        }
+        knot{
+            factor{"1852/3600"}
+            target{"meter-per-second"}
+        }
+        light-year{
+            factor{"9460730000000000"}
+            target{"meter"}
+        }
+        liter{
+            factor{"0.001"}
+            target{"cubic-meter"}
+        }
+        metric-ton{
+            factor{"1000"}
+            target{"kilogram"}
+        }
+        mile{
+            factor{"f2m*5280"}
+            target{"meter"}
+        }
+        mile-per-gallon{
+            factor{"235.215"}
+            reciprocal{"TRUE"}
+            target{"liter-per-kilometer"}
+        }
+        mile-scandinavian{
+            factor{"10000"}
+            target{"meter"}
+        }
+        minute{
+            factor{"3600"}
+            target{"second"}
+        }
+        mole{
+            factor{"6.02214076E+23"}
+            target{"one"}
+        }
+        nautical-mile{
+            factor{"1852"}
+            target{"meter"}
+        }
+        newton{
+            factor{"1"}
+            target{"kilogram-meter-per-square-second"}
+        }
+        ohm{
+            factor{"1"}
+            target{"kilogram-square-meter-per-cubic-second-square-ampere"}
         }
         one{
-            mole{
-                factor{"6.02214076E+23"}
-            }
-        }
-        one-per-one{
-            karat{
-                factor{"1/24"}
-            }
-            percent{
-                factor{"1/100"}
-            }
-            permille{
-                factor{"1/1000"}
-            }
-            permyriad{
-                factor{"1/10000"}
-            }
-        }
-        one-per-second{
-            hertz{
-                factor{"1"}
-            }
-        }
-        second{
-            day{
-                factor{"86400"}
-            }
-            day-person{
-                factor{"86400"}
-            }
-            hour{
-                factor{"3600"}
-            }
-            minute{
-                factor{"3600"}
-            }
-            week{
-                factor{"604800"}
-            }
-            week-person{
-                factor{"604800"}
-            }
-        }
-        square-meter{
-            acre{
-                factor{"f2m^2 * 43560"}
-            }
-            dunam{
-                factor{"1000"}
-            }
-            hectare{
-                factor{"10000"}
-            }
-        }
-        square-meter-kilogram-per-cubic-second{
-            horsepower{
-                factor{"ft2m * lb2kg * gravity * 550"}
-            }
+            factor{"1"}
+            target{"1"}
+        }
+        ounce{
+            factor{"lb2kg/16"}
+            target{"kilogram"}
+        }
+        ounce-troy{
+            factor{"0.03110348"}
+            target{"kilogram"}
+        }
+        parsec{
+            factor{"30856780000000000"}
+            target{"meter"}
+        }
+        pascal{
+            factor{"1"}
+            target{"kilogram-per-meter-square-second"}
+        }
+        percent{
+            factor{"1/100"}
+            target{"one-per-one"}
+        }
+        permille{
+            factor{"1/1000"}
+            target{"one-per-one"}
+        }
+        permyriad{
+            factor{"1/10000"}
+            target{"one-per-one"}
+        }
+        pint{
+            factor{"cup2m3 * 2"}
+            target{"cubic-meter"}
+        }
+        pint-metric{
+            factor{"0.0005"}
+            target{"cubic-meter"}
+        }
+        pound{
+            factor{"lb2kg"}
+            target{"kilogram"}
+        }
+        pound-force{
+            factor{"lb2kg * gravity"}
+            target{"kilogram-meter-per-square-second"}
+        }
+        quart{
+            factor{"cup2m3 * 4"}
+            target{"cubic-meter"}
+        }
+        radian{
+            factor{"180/PI"}
+            target{"degree"}
+        }
+        revolution{
+            factor{"360"}
+            target{"degree"}
+        }
+        stone{
+            factor{"lb2kg*14"}
+            target{"kilogram"}
+        }
+        tablespoon{
+            factor{"cup2m3/16"}
+            target{"cubic-meter"}
+        }
+        teaspoon{
+            factor{"cup2m3/48"}
+            target{"cubic-meter"}
+        }
+        therm-us{
+            factor{"105506000"}
+            target{"kilogram-square-meter-per-square-second"}
+        }
+        ton{
+            factor{"lb2kg*2000"}
+            target{"kilogram"}
+        }
+        volt{
+            factor{"1"}
+            target{"kilogram-square-meter-per-cubic-second-ampere"}
+        }
+        watt{
+            factor{"1"}
+            target{"kilogram-square-meter-per-cubic-second"}
+        }
+        week{
+            factor{"604800"}
+            target{"second"}
+        }
+        week-person{
+            factor{"604800"}
+            target{"second"}
+        }
+        yard{
+            factor{"f2m*3"}
+            target{"meter"}
         }
     }
     unitConstants{
index 607cba294b16addadf6ff462f12fa75e96e92e32..7077593c8f7cd664a8cb06814ec29daba35d3733 100644 (file)
     ; /unitConstants/$1 ; values=$2
 
 //supplementalData/convertUnits/convertUnit[@source="(%W)"][@target="(%W)"][@factor="(%A)"]
-    ; /convertUnits/$2/$1/factor ; values="$3"
+    ; /convertUnits/$1/target ; values=$2
+    ; /convertUnits/$1/factor ; values="$3"
 
 //supplementalData/convertUnits/convertUnit[@source="(%W)"][@target="(%W)"][@factor="(%A)"][@offset="(%A)"]
-    ; /convertUnits/$2/$1/factor ; values="$3"
-    ; /convertUnits/$2/$1/offset ; values=$4
+    ; /convertUnits/$1/target ; values=$2
+    ; /convertUnits/$1/factor ; values="$3"
+    ; /convertUnits/$1/offset ; values=$4
 
 //supplementalData/convertUnits/convertUnit[@source="(%W)"][@target="(%W)"][@factor="(%A)"][@reciprocal="(%A)"]
-    ; /convertUnits/$2/$1/factor ; values="$3"
-    ; /convertUnits/$2/$1/reciprocal ; values=$4
+    ; /convertUnits/$1/target ; values=$2
+    ; /convertUnits/$1/factor ; values="$3"
+    ; /convertUnits/$1/reciprocal ; values=$4
 
 # languageInfo.xml