Component
RadixPact
Choose a counting system to replace the displayed value with its actual representation in base 10, base 3 or base 12. Void the pact restores the ordinary decimal display.
Possible use
It could let a reviewer choose the counting constitution of a handoff estimate, or let a presenter make an agenda counter negotiate with a dozen-way calendar. The arithmetic stays correct while the choice adds needless governance.
Reasonable alternative
A reasonable local alternative is formatting a number once at the boundary where its representation matters. A value should not need a public treaty to remain legible.
01 / Preview
Try it yourself.
The same value, politically reformatted144Choose a counting system below.
Mechanism
- 1
- Begin with one ordinary value: 144.
- 2
- Choose Decimal, Ternary or Duodecimal.
- 3
- Watch the actual representation change while the value stays equal.
- 4
- Void the pact when the number wants to be ordinary again.
02 / Usage
Put it somewhere.
example.tsxTSX
import { RadixPact } from "gra-ui";
import "gra-ui/styles.css";
export function ContractValue() {
return <RadixPact value={144} />;
}03 / API
Small surface area.
PropTypeDescription
valuenumberThe integer value rendered in the selected numerical base.