简体   繁体   English

通过区块链API进行比特币格式化

[英]Bitcoin formatting via Blockchain API

I am using the Blockchain api at: https://github.com/blockchain/api-v1-client-csharp/blob/master/docs/blockexplorer.md 我在以下位置使用Blockchain api: https : //github.com/blockchain/api-v1-client-csharp/blob/master/docs/blockexplorer.md

and I am using on of the functions: var address = blockExplorer.GetAddress(myAddress); 我正在使用以下功能:var address = blockExplorer.GetAddress(myAddress);

which for a balance of: 0.03644624 BTC will return the number: 3644624 其中余额为:0.03644624 BTC将返回数字:3644624

Now what I am trying to do is get this returned number back into the format: 0.00000000 现在我想做的就是将此返回的数字重新设置为以下格式:0.00000000

I am wondering what would be the best and most efficient way of doing this? 我想知道这样做的最好和最有效的方法是什么? I am assuming if I got the number: 113644624 returned it would then be: 1.13644624 when formatted correctly. 我假设如果得到数字:113644624,则返回正确格式时为:1.13644624。

Thanks guys! 多谢你们!

This should work 这应该工作

var address = 3644624;
var t = address * Math.Pow(10,-8);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM