web3-format-number

Format Web3 numbers with formatUnits and parseUnits for UI display.

Updated Feb 2, 2026
One-click install
npx skills add https://github.com/pelith/Project-Remora-Frontend --skill web3-format-number
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web3-format-number
Source: https://github.com/pelith/Project-Remora-Frontend/tree/main/.cursor/skills/web3-format-number
Command: npx skills add https://github.com/pelith/Project-Remora-Frontend --skill web3-format-number

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides guidance for formatting and displaying Web3 numbers, enabling consistent readability and accurate representations of on-chain values.

Core Features & Use Cases

  • Number formatting: Convert raw token amounts to user-friendly strings with appropriate decimal handling.
  • Unit conversions: Support converting between raw BigNumber values and formatted strings using formatUnits and parseUnits.
  • Use Case: Visualize a user’s token balance in dashboards with correct decimals and readable suffixes.

Quick Start

Format a raw token amount (e.g., 2000000000000000000) into a human-friendly string using 18 decimals.

Frequently Asked Questions about web3-format-number

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format raw Web3 token balances for UI display?

Convert raw token balances into human-readable strings for UI display using formatUnits to apply correct decimal handling, ensuring accurate representations of on-chain values.

What's the best way to convert user input strings to raw on-chain values for smart contracts?

Convert user input strings to raw on-chain values for smart contract interactions using parseUnits to ensure correct decimal handling across write flows in decentralized apps.

Does formatting Web3 numbers require viem or wagmi and bignumber.js?

Formatting Web3 numbers requires viem or wagmi and bignumber.js, relying on formatUnits and parseUnits utilities to ensure correct decimal handling for both read and write flows.

Why does my token balance calculation return inaccurate values in my decentralized app?

Inaccurate token balance calculations often occur when raw BigNumber values bypass formatUnits and parseUnits utilities, which are required to ensure correct decimal handling across on-chain calculations.

Can I use formatUnits and parseUnits for both read and write flows in decentralized apps?

You can use formatUnits and parseUnits for both read and write flows in decentralized apps to handle number formatting for display and unit conversions for on-chain arithmetic.