Currency Formats (2024)

Last updated

Edit

The XRP Ledger has two kinds of digital asset: XRP and tokens. Both types have high precision, although their formats are different.

Comparison

The following table summarizes some of the differences between XRP and tokens in the XRP Ledger:

XRPTokens
Has no issuer.Always issued by an XRP Ledger account.
Specified as a string.Specified as an object.
Tracked in accounts.Tracked in trust lines.
Can never be created; can only be destroyed.Can be issued or redeemed freely.
Minimum value: 0. (Cannot be negative.)Minimum value: -9999999999999999e80. Minimum nonzero absolute value: 1000000000000000e-96.
Maximum value 100000000000 (1011) XRP. That's 100000000000000000 (1017) "drops".Maximum value 9999999999999999e80.
Precise to the nearest "drop" (0.000001 XRP)15 decimal digits of precision.
Can't be frozen.The issuer can freeze balances.
No transfer fees; XRP-to-XRP payments are always direct.Can take indirect paths with each issuer charging a percentage transfer fee.
Can be used in Payment Channels and Escrow.Not compatible with Payment Channels or Escrow.

For more information, see What is XRP? and Tokens.

Specifying Currency Amounts

Use the appropriate format for the type of currency you want to specify:

  • XRP Amounts
  • Token Amounts

XRP Amounts

To specify an amount of XRP, use a String Number indicating drops of XRP, where each drop is equal to 0.000001 XRP. For example, to specify 13.1 XRP:

"13100000"

Do not specify XRP as an object.

XRP amounts cannot be negative.

Token Amounts

To specify an amount of a (fungible) token, use an Amount object. This is a JSON object with three fields:

FieldTypeDescription
currencyString - Currency CodeArbitrary currency code for the token. Cannot be XRP.
valueString NumberQuoted decimal representation of the amount of the token. This can include scientific notation, such as 1.23e11 meaning 123,000,000,000. Both e and E may be used. This can be negative when displaying balances, but negative values are disallowed in other contexts such as specifying how much to send.
issuerStringGenerally, the account that issues this token. In special cases, this can refer to the account that holds the token instead (for example, in a Clawback transaction).

Caution: These field names are case-sensitive.

For example, to represent $153.75 US dollars issued by account r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59, you would specify:

{ "currency": "USD", "value": "153.75", "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59"}

Specifying Without Amounts

In some cases, you need to define an asset (which could be XRP or a token) without a specific amount, such as when defining an order book in the decentralized exchange.

To describe a token without an amount, specify it as a currency object, but omit the value field. For example:

{ "currency": "TST", "issuer": "rP9jPyP5kyvFRb6ZiRghAGw5u8SGAmU4bd"}

To describe XRP without an amount, specify it as a JSON object with only a currency field. Never include an issuer field for XRP. For example:

{ "currency": "XRP"}

String Numbers

XRP Ledger APIs generally use strings, rather than native JSON numbers, to represent numeric amounts of currency for both XRP and tokens. This protects against a loss of precision when using JSON parsers, which may automatically try to represent all JSON numbers in a floating-point format. Within the String value, the numbers are serialized in the same way as native JSON numbers:

  • Base-10.
  • Non-zero-prefaced.
  • May contain . as a decimal point. For example, ½ is represented as 0.5. (American style, not European)
  • Negative amounts start with the character -.
  • May contain E or e to indicate being raised to a power of 10 (scientific notation). For example, 1.2E5 is equivalent to 1.2×105, or 120000. Negative exponents are also possible.
  • No comma (,) characters are used.

XRP Precision

XRP has the same precision as a 64-bit unsigned integer where each unit is equivalent to 0.000001 XRP. It uses integer math, so that any amount less than a full drop is rounded down.

Token Precision

Tokens can represent a wide variety of assets, including those typically measured in very small or very large denominations. This format uses significant digits and a power-of-ten exponent in a similar way to scientific notation. The format supports positive and negative significant digits and exponents within the specified range. Unlike typical floating-point representations of non-whole numbers, this format uses integer math for all calculations, so it always maintains 15 decimal digits of precision. Multiplication and division have adjustments to compensate for over-rounding in the least significant digits.

When sending token amounts in the XRP Ledger's peer-to-peer network, servers serialize the amount to a 64-bit binary value.

Tip: For tokens that should not be divisible at all, see Non-Fungible Tokens (NFTs).

Currency Codes

The HTTP / WebSocket APIs support two formats of currency code:

Tokens with the same code can ripple across connected trust lines. Currency codes have no other behavior built into the XRP Ledger.

Standard Currency Codes

The standard format for currency codes is a three-character string such as USD. This is intended for use with ISO 4217 Currency Codes. The following rules apply:

  • Currency codes must be exactly 3 ASCII characters in length. The following characters are permitted: all uppercase and lowercase letters, digits, as well as the symbols ?, !, @, #, $, %, ^, &, *, <, >, (, ), {, }, [, ], and |.
  • Currency codes are case-sensitive.
  • The currency code XRP (all-uppercase) is disallowed. Real XRP typically does not use a currency code in the XRP Ledger protocol.

At the protocol level, this format is serialized into a 160-bit binary value starting with 0x00.

Nonstandard Currency Codes

You can also use a 160-bit (40-character) hexadecimal string such as 015841551A748AD2C1F76FF6ECB0CCCD00000000 as the currency code. To prevent this from being treated as a "standard" currency code, the first 8 bits MUST NOT be 0x00.

Deprecated: Some previous versions of ripple-lib supported an "interest-bearing" or "demurraging" currency code type. These codes have the first 8 bits 0x01. Demurraging / interest-bearing currencies are no longer supported, but you may find them in ledger data. For more information, see Demurrage.

Previous page

Next page

Currency Formats (2024)

FAQs

What is the correct format for currency? ›

Write amounts using the relevant currency symbol followed by numerals. Don't put a space between the currency symbol and the numerals.

Can Excel format an answer as currency? ›

Select the cells that you want to format and then, in the Number group on the Home tab, click the down arrow in the Number Format box. Choose either Currency or Accounting.

What is format currency? ›

Returns an expression formatted as a currency value using the currency symbol defined in the system control panel.

What is currency answers? ›

Currency is a medium of exchange for goods and services. In general, it's money in the form of paper and coins, usually issued by a government and generally accepted at its face value as a method of payment.

What is the correct format for USD? ›

Write the dollar figure first, followed by a non-breaking space and the code: 350 000 USD.

What is valid currency format? ›

$, , R$), or ISO 4217 international currency codes (for example, USD, EUR, BRL). Currency symbols may be placed before, within, or after the radix character of the monetary amount, and there may or may not be a space between the symbol and the amount.

How do I fix currency format in Excel? ›

Tip: You can also press Ctrl+1 to open the Format Cells dialog box. In the Format Cells dialog box, in the Category list, click Currency or Accounting. In the Symbol box, click the currency symbol that you want.

How is the US currency format with a comma? ›

In the US, dollars and cents are separated by a decimal point and thousands are separated by a comma. But in many countries the opposite is true—they use commas for fractional separators and decimals for thousand separators.

Can I use Excel to convert currency? ›

To convert currency in Excel, you need to have a column that includes the original values in one currency. It is recommended to label the column clearly to avoid confusion. If your original values are not in a specific currency format, you might need to format the column accordingly to ensure accurate conversion.

How do you format currency in numbers? ›

Currency (units of monetary value)

Select the cells or table you want to format. In the Format sidebar, click the Cell tab, then click the Data Format pop-up menu and choose Currency.

How do you format currency in sheets? ›

To apply a custom currency format to your spreadsheet:
  1. On your computer, open a spreadsheet in Google Sheets.
  2. Highlight the data you want to format.
  3. Click Format. Number.
  4. Click Custom currency.
  5. Search in the menu text box to select a format. You can also add your own custom currency format into the text box.
  6. Click Apply.

What is the string format for currency? ›

Standard format specifiers
Format specifierName
"C" or "c"Currency
"D" or "d"Decimal
"E" or "e"Exponential (scientific)
"F" or "f"Fixed-point
7 more rows
Apr 25, 2023

What is currency examples? ›

Under this definition, the British Pound sterling (£), euros (€), Japanese yen (¥), and U.S. dollars (US$) are examples of (government-issued) fiat currencies.

What do you mean by currency short answer? ›

What Is the Meaning of currency? Currency serves as a means of exchanging commodities and services. Money in the form of paper or coins, issued by a government and accepted at face value, is known as currency. In bartering, goods and services were exchanged directly for other goods and services .

What is the currency of the USA? ›

The United States dollar (symbol: $; currency code: USD; also abbreviated US$ to distinguish it from other dollar-denominated currencies; referred to as the dollar, U.S. dollar, American dollar, or colloquially buck) is the official currency of the United States and several other countries.

How do you write currency formally? ›

- All currency symbols are placed before the number amount without any spacing. Likewise, the abbreviation of a currency (e.g. USD or, EUR) should precede the number amount with a space. She received $500 from her grandmother. I only brought EUR 400 with me for the week.

How is US currency written? ›

The United States dollar (symbol: $; currency code: USD; also abbreviated US$ to distinguish it from other dollar-denominated currencies; referred to as the dollar, U.S. dollar, American dollar, or colloquially buck) is the official currency of the United States and several other countries.

How do you write money amounts correctly? ›

Dollars, cents, money

Use lowercase for denominations: dollar, cent, euro. Do not hyphenate numerals and denominations. Cents: For amounts less than a dollar, spell out cents. Exceptions: Use the dollar sign with numerals in all cases except casual references of amounts without a numeral: about a hundred dollars.

What is the Accounting format for currency? ›

The Currency format is used for "general monetary values" and puts the dollar sign directly in front of the left-most number. The Accounting format, on the other hand, lines up both the dollar sign as well as the decimal in the column of numbers.

Top Articles
Sending and Receiving Tokens Using Nami Wallet - Learn Cardano
React Router vs. React DOM: Which to Use?
Beacon Schnider
Craigslist Kennewick Pasco Richland
Tribune Seymour
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Remnant Graveyard Elf
Craigslist Pets Sac
Los Angeles Craigs List
Mini Handy 2024: Die besten Mini Smartphones | Purdroid.de
Best Forensic Pathology Careers + Salary Outlook | HealthGrad
Pekin Soccer Tournament
3S Bivy Cover 2D Gen
Ms Rabbit 305
Msu 247 Football
Saritaprivate
Tinker Repo
Isaidup
R. Kelly Net Worth 2024: The King Of R&B's Rise And Fall
The Listings Project New York
Weve Got You Surrounded Meme
Craigslist Alo
Aliciabibs
Colonial Executive Park - CRE Consultants
Jcp Meevo Com
Bolsa Feels Bad For Sancho's Loss.
Workshops - Canadian Dam Association (CDA-ACB)
55Th And Kedzie Elite Staffing
Pronóstico del tiempo de 10 días para San Josecito, Provincia de San José, Costa Rica - The Weather Channel | weather.com
Speechwire Login
What is Software Defined Networking (SDN)? - GeeksforGeeks
Little Einsteins Transcript
Darktide Terrifying Barrage
Missing 2023 Showtimes Near Grand Theatres - Bismarck
Roadtoutopiasweepstakes.con
Frostbite Blaster
11 Pm Pst
4083519708
Metro By T Mobile Sign In
Midsouthshooters Supply
Craigslist Summersville West Virginia
Tirage Rapid Georgia
Bones And All Showtimes Near Johnstown Movieplex
Blackwolf Run Pro Shop
COVID-19/Coronavirus Assistance Programs | FindHelp.org
Gon Deer Forum
Best Suv In 2010
Mail2World Sign Up
Ciara Rose Scalia-Hirschman
Subdomain Finer
Latest Posts
Article information

Author: Madonna Wisozk

Last Updated:

Views: 6246

Rating: 4.8 / 5 (68 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Madonna Wisozk

Birthday: 2001-02-23

Address: 656 Gerhold Summit, Sidneyberg, FL 78179-2512

Phone: +6742282696652

Job: Customer Banking Liaison

Hobby: Flower arranging, Yo-yoing, Tai chi, Rowing, Macrame, Urban exploration, Knife making

Introduction: My name is Madonna Wisozk, I am a attractive, healthy, thoughtful, faithful, open, vivacious, zany person who loves writing and wants to share my knowledge and understanding with you.