<s> import decimal <EOL> SATOSHI_PER_COIN = decimal . Decimal ( int ( <NUM_LIT> ) ) <EOL> COIN_PER_SATOSHI = decimal . Decimal ( <NUM_LIT:1> ) / SATOSHI_PER_COIN <EOL> SATOSHI_TO_MBTC = decimal . Decimal ( int ( <NUM_LIT> ) ) <EOL> def satoshi_to_btc ( satoshi_count ) : <EOL> if satoshi_count == <NUM_LIT:0> : <EOL> return decimal . Decimal ( <NUM_LIT:0> ) <EOL> r = satoshi_count * COIN_PER_SATOSHI <EOL> return r . normalize ( ) <EOL> def btc_to_satoshi ( btc ) : <EOL> return int ( decimal . Decimal ( btc ) * SATOSHI_PER_COIN ) <EOL> def satoshi_to_mbtc ( satoshi_count ) : <EOL> if satoshi_count == <NUM_LIT:0> : <EOL> return decimal . Decimal ( <NUM_LIT:0> ) <EOL> r = satoshi_count / SATOSHI_TO_MBTC <EOL> return r . normalize ( ) <EOL> def mbtc_to_satoshi ( btc ) : <EOL> return int ( decimal . Decimal ( btc ) * SATOSHI_TO_MBTC ) </s>
