Command/setupunit

Unofficial ConTeXt Wiki mirror

Last modified: 2024-08-24

Summary

The command \setupunit is used to define the way \unit and \digits work.

Settings

\setupunit[...,...][...=...,...]
[...,...] name
method 1 2 3 4 5 6
language language
alternative text mathematics
order reverse normal
separator small medium big normal none name
space small medium big normal none name
style style command
color color

Option Explanation
method
conversion of numbers (output), presets for separator and space
1 separator as period, decimal mark as comma: 12.345,67
2 separator as comma, decimal mark as period: 12,345.67 (default)
3 separator as thin space, decimal mark as comma: 12\,345,67
4 separator as thin space, decimal mark as period: 12.345.67
5 separator as full space, decimal mark as comma: 12 345,67
6 separator as full space, decimal mark as period: 12 345.67
language
(apparently not yet implemented)
order
conversion of numbers (input)
reverse read comma as decimal mark, point as separator
normal read point as decimal mark, comma as separator
separator
name e.g. cdot

Description

Examples

Example 1

  • \starttabulate[|r|r|r|]
    \HL
    \NC 0 \NC \setupunit[method=0]\unit{00,000.10 kilogram}
          \NC \setupunit[method=0]\unit{@@,@@0.10 kilogram} \NC \NR
    \NC 1 \NC \setupunit[method=1]\unit{00,000.10 kilogram}
          \NC \setupunit[method=1]\unit{@@,@@0.10 kilogram} \NC \NR
    \NC 2 \NC \setupunit[method=2]\unit{00,000.10 kilogram}
          \NC \setupunit[method=2]\unit{@@,@@0.10 kilogram} \NC \NR
    \NC 3 \NC \setupunit[method=3]\unit{00,000.10 kilogram}
          \NC \setupunit[method=3]\unit{@@,@@0.10 kilogram} \NC \NR
    \NC 4 \NC \setupunit[method=4]\unit{00,000.10 kilogram}
          \NC \setupunit[method=4]\unit{@@,@@0.10 kilogram} \NC \NR
    \NC 5 \NC \setupunit[method=5]\unit{00,000.10 kilogram}
          \NC \setupunit[method=5]\unit{@@,@@0.10 kilogram} \NC \NR
    \NC 6 \NC \setupunit[method=6]\unit{00,000.10 kilogram}
          \NC \setupunit[method=6]\unit{@@,@@0.10 kilogram} \NC \NR
    \HL
    \stoptabulate
    

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: