Docs
AppsAppsPackagesPackagesCustom ShopfrontCustom ShopfrontEnterpriseEnterprise (opens in a new tab)
GitHubDiscord
  • Blog
    • Overview
    • Overview
    • Getting started
    • Set up NextJs app
    • Airsoko packages
      • Getting started
      • Installation
      • Reference
      • Getting started
      • Installation
      • Quick start
      • Installation
      • Documentation
      • Getting started
      • Installation
      • Package Reference
      • Getting started
      • Installation
        • AddToCartButton
        • BuyNowButton
        • CartCheckoutButton
        • CartCost
        • CartLinePrice
        • CartLineQuantity
        • CartLineQuantityAdjustButton
        • Money
        • ProductPrice
        • ProductQuantityAdjustButton
        • ShopPayButton
        • WishlistButton
        • useAirsokoCookies
        • useCart
        • useCartLine
        • useLoadScript
        • useMoney
        • useProduct
        • useShop
        • useWishlist
        • ReactProvider
        • CartLineProvider
        • CartProvider
        • CheckoutProvider
        • ProductProvider
        • WishlistProvider
        • formatPrice
        • getItemById
        • removeItemFromArray
  • About

On This Page

  • Usage
  • Parameters
  • Returns
Question? Give us feedback → (opens in a new tab)Edit this page on GitHub
Packages
react
utilities
formatPrice

formatPrice

Formats a price as a string in the format "$X.YY", with two decimal places.

Usage

import formatPrice from "@airsoko/react";
 
const price = 10.5;
const formattedPrice = formatPrice(price);
console.log(formattedPrice); // Output: $10.50

Parameters

  • price: The price to format.

Returns

The formatted price as a string.

WishlistProvidergetItemById

Footer

Resources

  • Blog
  • Releases
  • Events

Developer

  • Documentation
  • API Reference
  • FAQ

Community

  • Integrations
  • Partner blog

Company

  • Airsoko
  • Collaborations
  • Contact Sales
  • X

Legal

  • Privacy Policy
  • Terms of Service

Support

  • GitHub
  • Discord

Subscribe to our newsletter

Subscribe to the Airsoko developer newsletter and stay updated on new releases and features, guides, and case studies.

© 2026 Airsoko, Inc. All rights reserved.