Wolfram Research

Function Repository Resource:

TallyMarks

Source Notebook

Represent an integer in various forms of tally marks

Contributed by: Sander Huisman

ResourceFunction["TallyMarks"][n]

outputs tally marks displaying the integer n.

ResourceFunction["TallyMarks"][n,type]

outputs type tally marks.

ResourceFunction["TallyMarks"][n,type,m]

uses at most m characters per line.

Details and Options

The value for n should be a non-negative integer.
The following types are supported:
"Default" uses tick marks used in e.g. Europe, Americas, Africa, Australia, and New Zealand
"Chinese" uses tick marks used in e.g. China, Taiwan, Japan, Korea, and countries that use Chinese characters
"Box" uses tick marks used in e.g. France, Spain, and their former colonies and Brazil
"DotsLines" uses tick marks used in forestry and related fields
The value for m should be a positive integer, ∞ or Automatic. For the setting Automatic, the marks will be set in a roughly square arrangement.

Examples

Basic Examples (3) 

Display 37 in tally marks:

In[1]:=
ResourceFunction["TallyMarks"][37]
Out[1]=

Use the Chinese type of tally marks instead:

In[2]:=
ResourceFunction["TallyMarks"][37, "Chinese"]
Out[2]=

Set a maximum of 5 characters per line:

In[3]:=
ResourceFunction["TallyMarks"][37, "Chinese", 5]
Out[3]=

Scope (4) 

Show the various types of tally marks for the number 42:

In[4]:=
Table[Column[{t, ResourceFunction["TallyMarks"][42, t]}, Center], {t, {"Default", "Chinese", "Box", "DotsLines"}}] // Column
Out[4]=

Set the number of symbols per line to 1:

In[5]:=
ResourceFunction["TallyMarks"][27, "Default", 1]
Out[5]=

Set the number of symbols per line to 5:

In[6]:=
ResourceFunction["TallyMarks"][62, "Default", 5]
Out[6]=

Create a roughly square arrangement:

In[7]:=
ResourceFunction["TallyMarks"][333, "Box", Automatic]
Out[7]=

Resource History

Related Resources

License Information