|
20 | 20 | _("Distance"): [ |
21 | 21 | # Base |
22 | 22 | ["m", _("metre"), _("metres"), "x * 1", "x * 1"], |
23 | | - # All below convert to/from base |
| 23 | + # All below convert to / from base |
24 | 24 | ["dm", _("decimetre"), _("decimetres"), "x / 10", "x * 10"], |
25 | 25 | ["mm", _("millimetre"), _("millimetres"), "x / 1000", "x * 1000"], |
26 | 26 | ["cm", _("centimetre"), _("centimetres"), "x / 100", "x * 100"], |
|
328 | 328 | "x * 0.0009478171", |
329 | 329 | ], |
330 | 330 | ], |
| 331 | + "data": [ |
| 332 | + # byte is the base |
| 333 | + ["B", _("byte"), _("bytes"), "x / 1", "x * 1"], |
| 334 | + ["KB", _("kilobyte"), _("kilobytes"), "x / 0.001", "x * 0.001"], # 10^3, |
| 335 | + ["MB", _("megabyte"), _("megabytes"), "x / 0.000001", "x * 0.000001"], # 10^6, |
| 336 | + [ |
| 337 | + "GB", |
| 338 | + _("gigabyte"), |
| 339 | + _("gigabytes"), |
| 340 | + "x / 0.000000001", |
| 341 | + "x * 0.000000001", |
| 342 | + ], # 10^9, |
| 343 | + [ |
| 344 | + "TB", |
| 345 | + _("terabyte"), |
| 346 | + _("terabytes"), |
| 347 | + "x / 0.000000000001", |
| 348 | + "x * 0.000000000001", |
| 349 | + ], # 10^12, |
| 350 | + [ |
| 351 | + "PB", |
| 352 | + _("petabyte"), |
| 353 | + _("petabytes"), |
| 354 | + "x / 0.000000000000001", |
| 355 | + "x * 0.000000000000001", |
| 356 | + ], # 10^15, |
| 357 | + # bits |
| 358 | + ["b", _("bit"), _("bits"), "x / 8", "x * 8"], # 1 byte = 8 bits |
| 359 | + ["Kb", _("kilobit"), _("kilobits"), "x / 0.008 ", "x * 0.008"], |
| 360 | + ["Mb", _("megabit"), _("megabits"), "x / 0.000008", "x * 0.000008"], |
| 361 | + ["Gb", _("gigabit"), _("gigabits"), "x / 0.000000008", "x * 0.000000008"], |
| 362 | + [ |
| 363 | + "Tb", |
| 364 | + _("terabit"), |
| 365 | + _("terabits"), |
| 366 | + "x / 0.000000000008", |
| 367 | + "x * 0.000000000008", |
| 368 | + ], |
| 369 | + [ |
| 370 | + "Pb", |
| 371 | + _("petabit"), |
| 372 | + _("petabits"), |
| 373 | + "x / 0.000000000000008", |
| 374 | + "x * 0.000000000000008", |
| 375 | + ], |
| 376 | + # IEC units |
| 377 | + # bytes |
| 378 | + [ |
| 379 | + "KiB", |
| 380 | + _("kibibyte"), |
| 381 | + _("kibibytes"), |
| 382 | + "x / 0.0009765625", |
| 383 | + "x * 0.0009765625", |
| 384 | + ], # 2^10 |
| 385 | + [ |
| 386 | + "MiB", |
| 387 | + _("mebibyte"), |
| 388 | + _("mebibytes"), |
| 389 | + "x / 0.00000095367431640625", |
| 390 | + "x * 0.00000095367431640625", |
| 391 | + ], # 2^20 |
| 392 | + [ |
| 393 | + "GiB", |
| 394 | + _("gibibyte"), |
| 395 | + _("gibibytes"), |
| 396 | + "x / 0.000000000931322574615478515625", |
| 397 | + "x * 0.000000000931322574615478515625", |
| 398 | + ], # 2^30 |
| 399 | + [ |
| 400 | + "TiB", |
| 401 | + _("tebibyte"), |
| 402 | + _("tebibytes"), |
| 403 | + "x / 0.0000000000009094947017729282379150390625", |
| 404 | + "x * 0.0000000000009094947017729282379150390625", |
| 405 | + ], # 2^40 |
| 406 | + [ |
| 407 | + "PiB", |
| 408 | + _("pebibyte"), |
| 409 | + _("pebibytes"), |
| 410 | + "x / 0.00000000000000088817841970012523233890533447265625", |
| 411 | + "x * 0.00000000000000088817841970012523233890533447265625", |
| 412 | + ], # 2^50 |
| 413 | + # bits each is 1024 of the previous |
| 414 | + [ |
| 415 | + "Kib", |
| 416 | + _("kibibit"), |
| 417 | + _("kibibits"), |
| 418 | + "x / 0.0078125", |
| 419 | + "x * 0.0078125", |
| 420 | + ], # 2^10 |
| 421 | + [ |
| 422 | + "Mib", |
| 423 | + _("mebibit"), |
| 424 | + _("mebibits"), |
| 425 | + "x / 0.00000762939453125", |
| 426 | + "x * 0.00000762939453125", |
| 427 | + ], # 2^20 |
| 428 | + [ |
| 429 | + "Gib", |
| 430 | + _("gibibit"), |
| 431 | + _("gibibits"), |
| 432 | + "x / 0.000000007450581", |
| 433 | + "x * 0.000000007450581", |
| 434 | + ], # 2^30 |
| 435 | + [ |
| 436 | + "Tib", |
| 437 | + _("tebibit"), |
| 438 | + _("tebibits"), |
| 439 | + "x / 0.0000000000007275958", |
| 440 | + "x * 0.0000000000007275958", |
| 441 | + ], # 2^40 |
| 442 | + [ |
| 443 | + "Pib", |
| 444 | + _("pebibit"), |
| 445 | + _("pebibits"), |
| 446 | + "x / 0.00000000000000000710542735760100185871124267578125", |
| 447 | + "x * 0.00000000000000000710542735760100185871124267578125", |
| 448 | + ], # 2^50 |
| 449 | + ], |
331 | 450 | } |
0 commit comments