2

I searched the unicode names for occurrences of "FOUR" and "FIVE" but didn't find anything. Nothing also when googling "unicode unary numbers".

Does anyone know unicode symbols for these?

akraf
  • 2,965
  • 20
  • 44

3 Answers3

3

What comes closest is “counting rod numerals”, included in Unicode (since version 5) on the basis of their use in China. They may not correspond to your idea of unary numerals, though. In particular, they have horizontal strokes, for U+1D360 COUNTING ROD UNIT DIGIT ONE to U+1D368 COUNTING ROD UNIT DIGIT NINE and vertical strokes for U+1D369 COUNTING ROD TENS DIGIT ONE to U+1D371 COUNTING ROD TENS DIGIT NINE.

They are included as U+1D360 to U+1D37F in the Counting Rod Numerals block and described verbally in Chapter 22, Symbols (page 757 of the standard, page 22 of the PDF file).

Font support is very limited. Here are the characters:

It is very probably that you do not see them properly, because no font in your system contains them.

The question would have been more suitable for SuperUser, as this is not really about programming. Regarding the programming aspect, note that these characters are outside the Basic Multilingual Plane, and this means that e.g. in Java and JavaScript, each of the characters is treated as two “characters” (a surrogate pair).

Community
  • 1
  • 1
Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390
2

Roman numerals are also available in Unicode:

Ⅰ Ⅱ Ⅲ Ⅳ Ⅴ Ⅵ Ⅶ Ⅷ Ⅸ Ⅹ Ⅺ Ⅻ Ⅼ Ⅽ Ⅾ Ⅿ ⅰ ⅱ ⅲ ⅳ ⅴ ⅵ ⅶ ⅷ ⅸ ⅹ ⅺ ⅻ ⅼ ⅽ ⅾ ⅿ ↀ ↁ ↂ Ↄ ↄ ↅ ↆ ↇ ↈ

Mathias Bynens
  • 144,855
  • 52
  • 216
  • 248
2

Rods

For characters with multiple strokes in one, you can use counting rod numerals (U+1D360 through U+1D371) and Roman numerals (U+2160 through U+2186).

Unicode   Surrogate Pair  UTF-8         Description                     Sample
———————   ——————————————  —————         ———————————                     ——————
U+1D360   U+D834 U+DF60   F0 9D 8D A0   COUNTING ROD UNIT DIGIT ONE     
U+1D361   U+D834 U+DF61   F0 9D 8D A1   COUNTING ROD UNIT DIGIT TWO     
U+1D362   U+D834 U+DF62   F0 9D 8D A2   COUNTING ROD UNIT DIGIT THREE   
.......   ...... ......   .. .. .. ..   ........ ... .... ..... .....   .
U+1D371   U+D834 U+DF71   F0 9D 8D B1   COUNTING ROD TENS DIGIT NINE    

Unicode  UTF-8      Description                      Sample
———————  —————      ———————————                      ——————
U+2160   E2 85 A0   ROMAN NUMERAL ONE                Ⅰ
U+2161   E2 85 A1   ROMAN NUMERAL TWO                Ⅱ
U+2162   E2 85 A2   ROMAN NUMERAL THREE              Ⅲ
......   .. .. ..   ..... ....... .....              .
U+2186   E2 86 86   ROMAN NUMERAL FIFTY EARLY FORM   ↆ

Slashes

You can use a combining mark to place a slash through any multi-stroke character. They should work with the counting rods and Roman numerals, but as with all fancy Unicode, browser and OS support may vary.

Unicode  UTF-8      Description                             Sample
———————  —————      ———————————                             ——————
U+0335   CC B5      COMBINING SHORT STROKE OVERLAY          ̵
U+0336   CC B6      COMBINING LONG STROKE OVERLAY           ̶
U+0337   CC B7      COMBINING SHORT SOLIDUS OVERLAY         ̷
U+0338   CC B8      COMBINING LONG SOLIDUS OVERLAY          ̸
U+20D2   E2 83 92   COMBINING LONG VERTICAL LINE OVERLAY    ⃒ 
U+20D3   E2 83 93   COMBINING SHORT VERTICAL LINE OVERLAY   ⃓

Here are the counting rods with the various combining stroke marks. They may or may not render in your browser. For me, only COMBINING LONG SOLIDUS OVERLAY seems to work well, even though they all display (Firefox 47 Mac).

̵
̶
̷
̸


̷
̸

Unfortunately, combining marks aren't always an option depending on the application. And many fonts lack them, though the OS will usually try to use whichever font has an otherwise missing Unicode character. Arial Unicode MS, Courier, Courier New, Geneva, Helvetica, Helvetica Neue, Tahoma, and Times New Roman are good bets for finding natively-included oddball glyphs like this.

Tick Marks in HTML

Here's a quick hack to get tick marks in pure HTML and CSS.

<style>
x-1::before, x-2::before, x-3::before, x-4::before, x-5::before {
    letter-spacing: 0.1pt; margin: 0.25em;
}
x-1::before { content: "|"; }
x-2::before { content: "||"; }
x-3::before { content: "|||"; }
x-4::before { content: "||||"; }
x-5::before { content: "|||||"; }
x-5::after  { content: "╱"; margin-left: -1.5em; }
</style>
<x-1/><x-2/><x-3/><x-4/><x-5/>

https://jsfiddle.net/b7z1mLj4/

Unary versus Quintary

As a side note, Unary numbers by definition have only one numeral, which is traditionally a vertical line. If you use single characters to represent the numbers 1 , 2 , 3 , 4 , and 5 , then what you have is a quintary (base-5) numeral system. Four-with-slash is not really a unary digit, but just a convenience for readability. It's akin to a space or comma when writing decimal numbers like 1,000,000.

That said, Unicode does have the comma symbol (and other flourishes), so you raise a great point over why there's no four-with-slash character. Especially since they have the counting rods.

Beejor
  • 8,606
  • 1
  • 41
  • 31