Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 5 Nov 2026. What's built · Install 0.3.0
jadpo
ReferenceCommerce and logistics

LanguageValues and typesStandard typesCommerce and logistics

Rating

On this page

A rating on its own scale: 4.5/5.

Use it for reviews and scores. It keeps its scale with it, so 4 of 5 and 8 of 10 aren't mixed up. For a plain percentage score, use Percentage.

Shape

Field Type Required?
value Decimal Yes
best Decimal Yes
worst Decimal Yes

Its parts keep these rules, and a value that breaks one fails with the rule's name:

  • best_above_worst: best > worst
  • value_on_scale: worst <= value and value <= best

Example

example
Rating { value: 4.5 best: 5.0 worst: 1.0 }

Good to know

  • best must be above worst, and value between them.
  • == tells you whether two are the same. < and list.sort_by don't take it, so sort by one of its parts instead.

In JSON

An object of its parts, in a request, a response or json.write:

json
{"value":"4.5","best":"5","worst":"1"}{"value":"8","best":"10","worst":"0"}{"value":"92","best":"100","worst":"0"}

Details

Text form, storage, how it is shown, and operations

Rating is in the group Commerce and logistics, and has been in Jadpo since 0.1.0.

Text form

It has no single text form, so text.from and text.parse don't take it.

How it is stored

It is stored in 3 columns, each named for the field, _ and its suffix. This is {"value":"92","best":"100","worst":"0"}:

Column Type Holds
<field>_value numeric 92
<field>_best numeric 100
<field>_worst numeric 0

How it is shown to people

text.format(value, locale:) shows it to people in their locale.

With locale: Locale.en_gb:

Value Shown
{"value":"4.5","best":"5","worst":"1"} 4.5/5
{"value":"8","best":"10","worst":"0"} 8/10
{"value":"92","best":"100","worst":"0"} 92/100
{"value":"1","best":"5","worst":"1"} 1/5

Operations

It also takes text.format, json.read, json.write and ==. How every standard type behaves says how they work.

Markdown for agents: /docs/types/type-rating.md.Built from Jadpo main at aee2e8f.