Bitcoin Forum
June 18, 2024, 07:21:04 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: CryptoNote orderbook math  (Read 94 times)
bukz (OP)
Newbie
*
Offline Offline

Activity: 154
Merit: 0


View Profile WWW
September 09, 2018, 06:51:31 PM
 #1

Hey guys, Looking to see if anyone may be able to chime in with some experience.

I'm working on a small exchange for Bukz, we will be able to trade among several CryptoNote. With CryptoNotes there's variable decimal places for each note. I'm trying to figure the best way of adding and subtracting when doing orderbook transactions.

I am storing each coins balance in atomic units, so 1buz = 100000000. since Bukz uses 8 decimal points I can divide that by 8 and add a precision function to display the current balance as 1.00000000 etc.

Now if another coin uses 9 decimal places, If I add the two atomic units together and then divide them with their respectable decimal units will this math come out correctly? Or is there another way to do this I'm yet to realize? Any help appreciated, good cheer.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!