Skip to content

Add helper for formatting key price display in XLM with correct decimal places #420

Description

@Chucks1093

Summary

Key prices from the contract are returned in stroops. The client needs a shared formatting helper that converts stroops to XLM and displays the result with a consistent number of decimal places across all price displays.

Scope

  • Add a formatKeyPrice(stroops: bigint): string utility function
  • Always display 2 decimal places for prices above 1 XLM, 4 decimal places for prices below 1 XLM
  • Add unit tests covering: zero, sub-1 XLM, exactly 1 XLM, large values

Acceptance Criteria

  • Helper converts stroops to XLM correctly
  • Decimal place rules are applied correctly
  • Unit tests pass for all boundary cases

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions