/*******************************************************************************
***  This file is part of Pecunia.                                           ***
***                                                                          ***
***  Copyright (C) 2017, 2018, 2019, 2020, 2021, 2023                        ***
***  John Schneiderman <Licencing _AT_ Schneiderman _DOT_ me>                ***
***                                                                          ***
***  This program is free software: you can redistribute it and/or modify it ***
***  under the terms of the GNU Lesser General Public License as published   ***
***  by the Free Software Foundation, either version 3 of the License, or    ***
***  (at your option) any later version.                                     ***
***                                                                          ***
***  This program is distributed in the hope that it will be useful, but     ***
***  WITHOUT ANY WARRANTY; without even the implied warranty of              ***
***  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                    ***
***  See the GNU Lesser General Public License for more details.             ***
***                                                                          ***
***  You should have received a copy of the GNU Lesser General Public License***
***  along with this program. If not, see <http://www.gnu.org/licenses/>.    ***
*******************************************************************************/
#ifndef PECUNIA_CONVERSION_H_
#define PECUNIA_CONVERSION_H_

#include "MoneyTypes.h"
#include <pecunia_export.h> // cppcheck-suppress missingInclude


namespace pecunia
{
namespace currency
{

enum class Iso4217Codes : std::uint16_t;

}}

namespace pecunia
{

/**
 * @brief Converts a non-precious minor value into an expected minor value, i.e. given a value of
 * USD 25 cents it'll convert it into "2500".
 *
 * @exception std::overflow_error When the supplied minor value is greater than possibly can be
 * stored in a currency's minor value.
 *
 * @param minor The minor value without the extra precision amount.
 * @param code The currency the minor unit is in.
 * @return The minor amount adjusted for the amount of precious and minor digits found in the
 * currency where all the precision is padded with zeros.
 */
PECUNIA_EXPORT MinorUnit toMinorUnit(const MinorUnit& minor, const currency::Iso4217Codes& code);

}

#endif
