Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.

Latest commit

 

History

History
29 lines (20 loc) · 660 Bytes

File metadata and controls

29 lines (20 loc) · 660 Bytes

Corrency - Useful Ecommerce Core extensions

Build Status

Usage

# Configure the VAT rate
Corrency::Config.vat_rate = 20.00

# Add VAT
BigDecimal.new('10.00').inc_vat # 12.00

# Remove VAT
BigDecimal.new('12.00').ex_vat # 10.00

# Roll up to nearest 99p
BigDecimal.new('12.76').next_ninety_nine # 12.99

# Add 10% Margin
BigDecimal.new('90.00').add_margin(10.00) # 100.00

# Calculate Margin
BigDecimal.new('100.00').margin(90.00) # 10.00

Copyright

Copyright (c) 2012 Robert Williams. See MIT-LICENSE for further details.