HomeJavaDatapacksNumber Converter
Number Converter
Number Converter — screenshot 1Number Converter — screenshot 2Number Converter — screenshot 3Number Converter — screenshot 4

NUMBER CONVERTER

A library datapack to make long numbers or scores readable.

Convert a value

Example command

function nc:convert/value {value:"1874"}

output

command: data get storage minecraft:number_converter

output: {output:{decimal_number:8,main_number:1,negative:0b,number:"1.8k",
number_without_suffix:"1.8",old_number:1874,positive:1b,prefix:"+",suffix:"k"}}

Directly convert the score

Example command

scoreboard players set tpcoffline your_objective 6452326
function nc:convert/score {name:"tpcoffline",objective:"your_objective"}

output

command: data get storage minecraft:number_converter

output: {output:{decimal_number:4,main_number:6,negative:0b,number:"6.4m",number_without_suffix:"6.4",
old_number:6452326,positive:1b,prefix:"+",suffix:"m"}}

Example usage

- Write the player's “money” score in chat.

command

scoreboard players set tpcoffline money 567428
function nc:convert/score {name:"tpcoffline",objective:"money"}
tellraw @a {"nbt":"output.number","storage":"number_converter","color":"gold","bold":true}

output

In game screenshot

Quick facts

Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more