CONVERTUOM.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <?php
  2. return [
  3. 'Imperial from and to (mass)' => [
  4. 1.942559385723E-03,
  5. 1.0,
  6. 'ozm',
  7. 'sg',
  8. ],
  9. 'Same prefixed metric UoM' => [
  10. 5.0,
  11. 5.0,
  12. 'kg',
  13. 'kg',
  14. ],
  15. 'Imperial to prefixed metric' => [
  16. 4.5359237E-01,
  17. 1.0,
  18. 'lbm',
  19. 'kg',
  20. ],
  21. 'Prefixed metric to prefixed metric, same unit' => [
  22. 0.2,
  23. 2.0,
  24. 'hg',
  25. 'kg',
  26. ],
  27. 'Unprefixed metric to prefixed metric, same unit' => [
  28. 12.345000000000001,
  29. 12345,
  30. 'm',
  31. 'km',
  32. ],
  33. 'Prefixed metric to unprefixed metric, same unit' => [
  34. 12345,
  35. 12.345000000000001,
  36. 'km',
  37. 'm',
  38. ],
  39. 'Prefixed metric to imperial' => [
  40. 0.62137119223732995,
  41. 1,
  42. 'km',
  43. 'mi',
  44. ],
  45. 'Prefixed metric to alternative metric' => [
  46. 1.23450000000000E+05,
  47. 12.345,
  48. 'um',
  49. 'ang',
  50. ],
  51. 'Prefixed metric to alternative prefixed metric' => [
  52. 1.23450000000000E+02,
  53. 12.345,
  54. 'um',
  55. 'kang',
  56. ],
  57. 'Prefixed metric to 2-character prefixed metric, same unit' => [
  58. 1000.0,
  59. 100.0,
  60. 'hl',
  61. 'dal',
  62. ],
  63. 'Imperial to Imperial (distance)' => [
  64. 1.0,
  65. 3.0,
  66. 'ft',
  67. 'yd',
  68. ],
  69. [
  70. 20,
  71. 68,
  72. 'F',
  73. 'C',
  74. ],
  75. [
  76. 68,
  77. 20,
  78. 'C',
  79. 'F',
  80. ],
  81. [
  82. 293.14999999999998,
  83. 68,
  84. 'F',
  85. 'K',
  86. ],
  87. [
  88. 68,
  89. 293.14999999999998,
  90. 'K',
  91. 'F',
  92. ],
  93. [
  94. -273.15,
  95. 0,
  96. 'K',
  97. 'C',
  98. ],
  99. [
  100. -459.67,
  101. 0,
  102. 'K',
  103. 'F',
  104. ],
  105. [
  106. 295.15,
  107. 22,
  108. 'C',
  109. 'K',
  110. ],
  111. [
  112. 22.5,
  113. 295.65,
  114. 'K',
  115. 'C',
  116. ],
  117. 'Melting Point of Titanium (K to C)' => [
  118. 1667.85,
  119. 1941,
  120. 'K',
  121. 'C',
  122. ],
  123. 'Melting Point of Titanium (K to F)' => [
  124. 3034.13,
  125. 1941,
  126. 'K',
  127. 'F',
  128. ],
  129. 'Melting Point of Titanium (K to Rankine)' => [
  130. 3493.8,
  131. 1941,
  132. 'K',
  133. 'Rank',
  134. ],
  135. 'Melting Point of Titanium (K to Réaumur)' => [
  136. 1334.28,
  137. 1941,
  138. 'K',
  139. 'Reau',
  140. ],
  141. 'Melting Point of Titanium (Rankine to K)' => [
  142. 1941,
  143. 3493.8,
  144. 'Rank',
  145. 'K',
  146. ],
  147. 'Melting Point of Titanium (Réaumur to K)' => [
  148. 1941,
  149. 1334.28,
  150. 'Reau',
  151. 'K',
  152. ],
  153. 'Temperature synonyms (K)' => [
  154. 123.45,
  155. 123.45,
  156. 'K',
  157. 'kel',
  158. ],
  159. 'Temperature synonyms (C)' => [
  160. 123.45,
  161. 123.45,
  162. 'C',
  163. 'cel',
  164. ],
  165. 'Temperature synonyms (F)' => [
  166. 123.45,
  167. 123.45,
  168. 'F',
  169. 'fah',
  170. ],
  171. 'Invalid value to convert' => [
  172. '#VALUE!',
  173. 'three',
  174. 'ft',
  175. 'yds',
  176. ],
  177. 'Imperial to 2-character prefixed imperial, same unit' => [
  178. '#N/A',
  179. 100.0,
  180. 'pt',
  181. 'dapt',
  182. ],
  183. 'Prefixed metric to binary prefixed metric' => [
  184. '#N/A',
  185. 12.345,
  186. 'um',
  187. 'kiang',
  188. ],
  189. 'Mismatched categories' => [
  190. '#N/A',
  191. 1,
  192. 'ft',
  193. 'day',
  194. ],
  195. 'From prefixed Imperial (Invalid)' => [
  196. '#N/A',
  197. 234.56,
  198. 'kpt',
  199. 'lt',
  200. ],
  201. 'To prefixed Imperial (Invalid)' => [
  202. '#N/A',
  203. 234.56,
  204. 'lt',
  205. 'kpt',
  206. ],
  207. 'From binary prefixed Imperial (Invalid)' => [
  208. '#N/A',
  209. 234.56,
  210. 'kiqt',
  211. 'pt',
  212. ],
  213. 'To binary prefixed Imperial (Invalid)' => [
  214. '#N/A',
  215. 234.56,
  216. 'pt',
  217. 'kiqt',
  218. ],
  219. 'From prefixed Imperial 2 (Invalid)' => [
  220. '#N/A',
  221. 12345.6,
  222. 'baton',
  223. 'cwt',
  224. ],
  225. 'To prefixed Imperial 2 (Invalid)' => [
  226. '#N/A',
  227. 12345.6,
  228. 'cwt',
  229. 'baton',
  230. ],
  231. 'Invalid from unit' => [
  232. '#N/A',
  233. 234.56,
  234. 'xxxx',
  235. 'm',
  236. ],
  237. 'Invalid to unit' => [
  238. '#N/A',
  239. 234.56,
  240. 'm',
  241. 'xxxx',
  242. ],
  243. 'Basic Information conversion' => [
  244. 2,
  245. 16,
  246. 'bit',
  247. 'byte',
  248. ],
  249. 'Information with standard metric prefix' => [
  250. 1000,
  251. 1,
  252. 'kbyte',
  253. 'byte',
  254. ],
  255. 'Information with binary prefix' => [
  256. 1024,
  257. 1,
  258. 'kibyte',
  259. 'byte',
  260. ],
  261. ];