在比特币中,1 sat 是多少美元?

资讯 2024-07-12 阅读:43 评论:0
普通人绝对想不到,比特币能在2024年达到这个价值,早知道的话,我当初就是破釜沉舟也得买一个啊。No ordinary man could have...

普通人绝对想不到,比特币能在2024年达到这个价值,早知道的话,我当初就是破釜沉舟也得买一个啊。

No ordinary man could have expected #xff0c; Bitcoin could have reached that value by 2024; if I had known, #xff0c; I had to buy one, too.

而在4月19号,也将迎来比特币再次减半。减半并不是说玩家手中的比特币要被突然减去一半,而是在后续的挖矿过程中,奖励减半。他的机制就是每开采210000个区块后,奖励减半。比如以前的旷工算出来1 + 1 = 2;后,可以得到10块钱奖励,那么4月19号以后,你费电,费机器,通过算出1 + 1 = 2;后,只能得到5块钱奖励了。

And on April 19 xff0c; it will also halve Bitcoin again. Half by half does not mean that the player's bitcoin is suddenly reduced by half xff0c; half by half in the follow-up mining process xff0c; half by half. His mechanism is xff0c; half by half. For example, one & #43; 1 #61; 2xff1b; xff0c; after xff0c; after April 19; your electricity #xff0c; your machine #xff0c; by counting 1 & #43; 1 & #61; 2ff1b; ff0c; after 5 dollars.

很多人欣喜若狂,哎呀,数量要减少啦,价格又要飙升啦,赶紧入手吧。我倒觉得大可不必,他涨他的,减少啥呀减少,后续的增长减半,又不是后续从玩家手中缩减,至于价格,你信不信,你不买他就飙升,你一买那个价格曲线就调过来。我反正不买。去年有个人玩数藏被坑了50W,据说有工资,有父母的钱,还有借的,你说这不是瞎闹嘛。更糟糕的是,这小伙儿,是个程序员。

A lot of people are excited about xff0c; xff0c; quantity is going down; prices are going up again xff0c; prices are going up xff0c; let's get started. I don't think he's going to have to xff0c; he's going up his xff0c; what's going down xff0c; what's going on xff0c; what's going on xff0c; what's going on xff0c; what's going on xff0c; what's going on xff0c; what's going on xff0c; what's going on xff0c; what's going on is not going on.

目录

Catalogue

1 sat

2 获取当前比特币的价格

3 封装获取价格方法?

4 根据聪和比特币价格,换算美元价格


?

1 sat

sat ,可以喊它为“聪”,当然不是他很聪明,而是有个叫“中本聪”的玩意,他是比特币的创始人,所以人们为了纪念这个“人”,将费率命名为“聪”。

Sat & #xff0c; it can be called "Hear" & #xff0c; it is certainly not he who is smart #xff0c; it is a thing called "Middle-Hear" & #xff0c; he is the founder of Bitcoin & #xff0c; so people remember this person & #xff0c; and the rate is named "Hear".

比如你这次交易需要给旷工多少钱,人们就说需要多少聪。比特币的最小单位是聪,一亿聪就等于一个比特币啦。如果你有空余时间,很感兴趣,可以来一聪试试水。所以每聪表示0.00000001BTC。

For example, how much you're going to pay for truancy xff0c; people say how much. The smallest unit of bitcoin is xff0c; 100 million is a bitcoin. If you have time left, xff0c; xff0c; you can try water. So every hearing is 0.000001 BTC.

2 获取当前比特币的价格

如果你在开发web3网站,那么肯定会涉及到获取当前比特币价格的需求。但这个价格变化非常快,几乎每秒都在波动,所以要不要频繁获取,你看自己需求而定,有时候产品会要求一分钟,十分钟这样。

If you're developing web3 & #xff0c; then there's certainly a demand for the current bitcoin price. But this price changes very quickly xff0c; it fluctuates almost every second xff0c; so you want to get xff0c more frequently; you see your needs xff0c; sometimes the product requires a minute xff0c; 10 minutes.

47bc6e7cd28e460c9c6acf19fda0a3a9.png

获取代码如下:

The following codes are obtained: xff1a;

 

这个price 字段就是需要获取的价格

This price

15c8dce687124548b5a234a7b4ea7c49.png

3 封装获取价格方法?

因为这个方法是异步的,肯定会有很多地方需要使用,所以需要将方法封装起来,返回一个promise这样,当其他地方需要的时候,通过async / await 的方式获取价格,代码如下:

Because it's a step-by-step xff0c; there's bound to be a lot of places to use xff0c; there's a need to encapsulate the method xff0c; to return a promise like xff0c; xff0c when needed elsewhere; to get prices xff0c through async/await; code xff1a;

 

4 根据聪和比特币价格,换算美元价格

比如某一笔服务费是2000聪,那么根据聪和比特币的比例换算,看代码:

For example, a service fee of 2,000 deaf #xff0c; conversion of xff0c based on the ratio of deaf and bitcoin; look at code xff1a;

 

但是需要注意的是,这样换算下来,必定是一个长小数,所以需要前端用toFixed(2)来转换一下用于展示。

But what needs to be noted is xff0c; this translates xff0c; it must be a long decimal xff0c; so the front end needs to convert to match(2) for presentation.

但如果得到的这个数值还要用于计算,就需要用foFixed(2)以前的数值来计算,更精确一些。?

But this value is also used to calculate & #xff0c; a previous value infoFixed(2) is needed to calculate & #xff0c; is it more accurate?

?

?

文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
热门文章
  • 以太坊区块链浏览器的搭建

    以太坊区块链浏览器的搭建
    环境;Ubuntu 首先需要下载git 参考链接:?http://www.360bchain.com/article/156.html??Environment; Ubuntu first needs to download git reference link: ˂a rel="noformlow" href="http://www.360bchai.com/article/156.html"? http://www.360bchai.com/article/156.htm...
  • 百度元宇宙希壤app官方下载

    百度元宇宙希壤app官方下载
    希壤元宇宙是一款非常好玩的休闲手游,这款游戏采用了元宇宙的游戏概念,超级自由的游戏玩法,在这里没有什么标准限定,你可以自由的在这里进行着一切你想做的事情,游戏比较的休闲和放松,没有什么操作难度,感兴趣的小伙伴们可以来007游戏网下载这款非常有趣的希壤元宇宙吧!˂a href=http://m.yx007.com/key/xxsy" target="_blank" , a game that uses the concept of meta-cosm, super-free p...
  • 【CoinCentral 合作內容】加密貨幣 Decred 正式推出 2018 發展路段線圖

    【CoinCentral 合作內容】加密貨幣 Decred 正式推出 2018 發展路段線圖
    早些時候,加密貨幣Decred發表了一篇博客文章,概述了他們2018年的正式發展路線圖。Earlier, encrypt currency Decred published a blog article outlining their official road map for development in 2018.在這個路線圖中,團隊在為他們制定營銷宣傳之前,明確地表明他們於建立和發布可交付物品的成果,同時將他們的營銷集中在項目的核心組成部分。Decred團隊正在研究一些...
  • 跨接在两个网络间的语音记录仪设计

    跨接在两个网络间的语音记录仪设计
      摘  要: 设计了语音记录仪。该语音记录仪桥接在通信设备之间,同时提供3种桥接接口:以太网接口,支持在IP通信方式下的各通话组的直通及录音功能;二线接口,支持模拟二线方式下的直通及录音功能;音频接口,支持模拟音频方式下的直通及录音功能。同时话音记录仪提供FTP服务器,可以通过局域网对语音记录仪保存的语音文件进行下载和管理。此外,该设备支持语音回放功能。 extracts & nbsp; to : The voice record...
  • 元宇宙概念股有哪些 元宇宙概念股一览表

    元宇宙概念股有哪些 元宇宙概念股一览表
    元宇宙概念股排行精选 元宇宙概念股一览表(2022/11/08),下文就随小蔡来简单的了解一下吧。The contours of the meta-cosmology unit are in the list of the meta-cosmological concept units (2022/11/08), so let's get to the bottom of this with Little Choi. 元宇宙概念股龙头有:The contou...
标签列表