One standard approach is to store both an amount and a currency whenever monetary values are held and manipulated.
See the Money Pattern in Martin Fowler's Patterns of Enterprise Application Architecture.
Fowler describes defining a simple datatype to hold the two primitive components, with overloaded arithmetical operators for performing monetary operations:
"The basic idea is to have a Money class with fields for the numeric
amount and the currency. You can store the amount as either an
integral type or a fixed decimal type. The decimal type is easier for
some manipulations, the integral for others. You should absolutely
avoid any kind of floating point type, as that will introduce the kind
of rounding problems that Money is intended to avoid. Most of the time
people want monetary values rounded to the smallest complete unit,
such as cents in the dollar. However, there are times when fractional
units are needed. It’s important to make it clear what kind of money
you’re working with, especially in an application that uses both
kinds. It makes sense to have different types for the two cases as
they behave quite differently under arithmetic.
Money needs arithmetic operations so that you can use money objects as
easily as you use numbers. But arithmetic operations for money have
some important differences to money operations in numbers. Most
obviously, any addition or subtraction needs to be currency aware so
you can react if you try to add together monies of different
currencies. The simplest, and most common, response is to treat the
adding together of disparate currencies as an error. In some more
sophisticated situations you can use Ward Cunningham’s idea of a money
bag. This is an object that contains monies of multiple currencies
together in one object. This object can then participate in
calculations just like any money object. It can also be valued into a
currency."