The job_value field is returned in cents, not dollars. A value of 1000000 represents $10,000.00. This is intentional and follows established API design patterns for handling monetary values.
Why Cents?
Returning monetary values in cents (the smallest currency unit) is a common practice in financial APIs. This approach:
- Avoids floating-point precision errors — representing $10.50 as
1050 cents eliminates rounding issues that can occur with decimal numbers
- Simplifies integer arithmetic — calculations with whole numbers are faster and more reliable
- Follows industry standards — major payment APIs like Stripe use the same convention
Converting to Dollars
To convert job_value to dollars in your application, divide by 100:
job_value_cents = 1000000
job_value_dollars = job_value_cents / 100 # Result: 10000.00
const jobValueCents = 1000000;
const jobValueDollars = jobValueCents / 100; // Result: 10000.00
When displaying monetary values to users, format the result as currency after converting from cents.
Related Articles