• No results found

The sepnum package

N/A
N/A
Protected

Academic year: 2021

Share "The sepnum package"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

The sepnum package

Separated numbers

Bernd Raichle

1996/09/05

This package provides a means of formatting numbers with (a) a decimal separator different of the default (‘.’) and (b) a separator (default ‘,’) every three digits.

First version of this package was posted to the newsgroup ‘de.comp.tex’ November 6th, 1995 (as ‘printnum.sty’).

1 Licensing condition

This program may be redistributed and/or modified under the terms of the LATEX

Project Public License, either version 1.0 of this license, or (at your option) any later version. The latest version of this license is in CTAN:macros/latex/base/lppl.txt.

2 Usage

The macro

\sepnum{〈c〉}{〈sbc〉}{〈sac〉}{〈number〉}

produces the 〈number〉 with the decimal point replaced by 〈c〉 and the separator 〈sbc〉 every three digits in the integer part, the separator 〈sac〉 every three digits in the fractional part of 〈number〉. \sepnum is fully expandable and not fragile, unless one of 〈c〉, 〈sbc〉, or 〈sac〉 is.

This manual corresponds to sepnum v2.0, dated 1996/09/05.Raichle@Informatik.Uni-Stuttgart.de

(2)

Example:

• a non realistic example to show the capabilities of \sepnum \sepnum{,}{*}{-}{1234.5678} ⇒ 1*234,567-8

• to print a number inserting small spaces each three digits \sepnum{.}{\,}{\,}{1234.5678} ⇒ 1 234.567 8

Additionally this package provides

\sepnumform{〈c〉}{〈sbc〉}{〈sac〉}{〈LATEX-counter〉}

to use \sepnum with a LATEX counter.

Example (with a decimal comma in the print form \the〈counter〉):

1 \newcounter{money}

2 \renewcommand{\themoney}{\sepnumform{,}{.}{}{money}} 3

4 \setcounter{money}{-1000} 5 You have \themoney{} left.

(For compatibility with ‘printnum.sty’, the macros \printnum{〈number〉} and \print-numKomma/\printnumTrenner still exist.)

3 See also

• Package “comma.sty” by David Carlisle which provides similar features for integers only, i. e. it misses support for the decimal point/comma in fixed point numbers.

• Package “numprint.sty” by Harald Harders supporting formatting of numbers given as 1234e5 in addition.

Referenties

GERELATEERDE DOCUMENTEN

In addition to the diagrams, there are macros that are intended to be used inline to make horizontal arrows, pointing left or right, plain, monic, epic, or user-definable shapes,

This package provides a means of producing numbers with a separator (by default a comma) every three digits. Given a L A TEX counter

If we use a turned comma to show the location a full point would occupy if ‘turned’ in the same way, we can see that the position is somewhat high, as in the decimal fraction

(In fact, ordinary LaTeX footnotes sometimes do not work well if they need splitting (e. producing blank pages, or appearing in shufled form): but these problems should not affect

If you are not using the memoir package, but wish to define your own actions to create appendix pages and such before the plates are printed, then you can manually define the

However, remember that texsurgery is a python project whose main focus is on evaluating code inside a jupyter kernel, and this is only achieved by installing the python package

Exclusion ends with the first detected \end{〈name〉}, even if there are additional \begin{〈name〉} declarations in the skipped text; that is, nesting of environments is not

In addition to the diagrams, there are macros that are intended to be used inline to make horizontal arrows, pointing left or right, plain, monic, epic, or user-definable shapes,