Skip to content

SpaceText

Namespace Nfty.Core.Generation in assembly Nfty.Core.

public static class SpaceText

How a counted DNA space is written down, for every surface that shows one.

Remarks

It lives in Core for the reason the reports in Stats/ do. The CLI's stats line and the CookBook card's tile each carried their own copy of the same three-branch decision, worded differently — one said "cannot be counted (the CookBook has problems; run validate)" and the other said an em dash. Two copies of a rule is how they stop agreeing, and this rule just gained a fourth branch.

The exact digits are always available, whatever the display shows. That is the whole point of the split below: a number the product refuses to print in full is a number the author cannot check, and this figure is the one they are tuning quantize steps against. Every surface that shortens is expected to put SpaceText.Exact() on its tooltip — unconditionally, so a reader learns once that hovering answers the question.

Fields

Unknown

public const string Unknown = "cannot be counted";

What is shown when nothing is known.

Methods

Compact(BigInteger)

public static string Compact(BigInteger value);

The figure as a tile or a chip should show it: exact where it fits, named magnitude where it does not, and an exponent where even that stops meaning anything.

Parameters

  • value (BigInteger) - The count.

Returns. e.g. 615,600, 2,560,000, 4.72 billion, or 2.18e21.

Remarks

The threshold is a billion, and it is deliberately high. Two approaches were on the table: scientific notation everywhere (2.56e6), or a named magnitude. Scientific is compact and precise and is the wrong register for this product — it asks an artist sizing a collection to decode an exponent, and "1.2e7 versus 9.8e6" is a comparison nobody makes at a glance. A named magnitude reads the way the app already talks about itself.

But the better idea is the third one: degrade only when you must. Everything below a billion prints in full, so essentially every real book shows its true figure, digit for digit — and the rounded form appears only where no tile could have held the digits anyway. The exact value is always one hover away.

Past a thousand quintillion the register changes, and that is the same rule applied once more. A BigInteger total has no ceiling, so a deep book really can reach 2.18e21 — six layers of ten variants at a 10°/10% quantize does. The argument against scientific notation was an argument about MILLIONS, where a name is plainly easier; at this size there is no name a reader knows, so the exponent is the more legible of the two and is also precisely what one is comparing.

The mantissa is always two decimal places, including 1.00 billion. These figures are read as a COLUMN — one row per recipe, stacked — and 0.## drops a trailing zero, so a book of 17.744 and one of 12.900 trillion printed as "17.74 trillion" over "12.9 trillion" and the decimal points did not line up. A number that changes shape with its value is the same defect the colorize range endpoints were fixed for; a fixed mantissa costs one redundant zero on a round figure and buys a column that reads straight down.

The rung is chosen AFTER rounding, not before. Picking it first and rounding afterwards printed 999,999,999,999 as "1000.00 billion" — a mantissa that has left its own rung, in a column whose whole purpose is that the rungs line up. Every value from 999,995,000,000 up hit it, and a real book reaches that. Rounding first and promoting when the mantissa reaches 1000 makes the pair consistent by construction.

Describe(BigInteger, SpaceCertainty, bool)

public static string Describe(BigInteger total, SpaceCertainty certainty, bool compact = false);

SpaceText.Describe(), for one recipe's share.

Parameters

  • total (BigInteger) - The figure.
  • certainty (SpaceCertainty) - What that figure is.
  • compact (bool) - Shorten a very large number.

Returns. Display text, never empty.

Describe(UniqueSpaceCount, bool)

public static string Describe(UniqueSpaceCount count, bool compact = false);

The whole sentence a surface shows: the figure, and what kind of figure it is.

Parameters

  • count (UniqueSpaceCount) - The counted space.
  • compact (bool) - Whether to shorten a very large number (SpaceText.Compact()) rather than print every digit (SpaceText.Exact()). A tile does; a report does not.

Returns. Display text, never empty.

Remarks

"more than" and "at most" are different sentences, and that is the point. Three outcomes used to share one bool and all three rendered as "more than N" — including the one where the real figure is SMALLER than what was printed. Naming the direction in SpaceCertainty is what makes each of them say something true.

Exact(BigInteger)

public static string Exact(BigInteger value);

The full figure, with thousands separators.

Parameters

  • value (BigInteger) - The count.

Returns. e.g. 615,600.

Remarks

Invariant, like every figure this product prints: reports are copied into issues and diffed against a colleague's run, and a machine set to de-DE would render this as 615.600 and make two identical books look different.