taxes

package module
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package taxes provides tax calculations based on the country and postal code.

This code is intended for demonstrating how module versions and imports work. Please don't use it in production code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForCountryPostalCode

func ForCountryPostalCode(countryCode string, postalCode string) (decimal.Decimal, error)

ForCountryPostalCode takes in two parameters, an ISO 3166-1 alpha-2 country code and a valid postal code for that country. It returns a decimal.Decimal with the sales tax rate. If the country code is invalid or the postal code cannot be processed, an error is returned.

func ForZip

func ForZip(zip string) (decimal.Decimal, error)

ForZip takes in a US 5-digit zip code as a string and returns the sales tax within the zip code as a decimal.Decimal. If the zip is not valid, an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL