-
Notifications
You must be signed in to change notification settings - Fork 37k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rationalize currency unit to "BTC" #6504
Conversation
Hello, I would suggest using XBT instead of the BTx is the ISO prefix for Bhutan. Regard, On Saturday, August 1, 2015, Ross Nicoll notifications@github.com wrote:
|
I'll leave others to discuss whether it should change, but this patch certainly makes it simpler by using a single constant (although QT wallet values would need to be updated independently) |
@@ -342,16 +342,17 @@ std::string HelpMessage(HelpMessageMode mode) | |||
strUsage += HelpMessageOpt("-disablewallet", _("Do not load the wallet and disable wallet RPC calls")); | |||
strUsage += HelpMessageOpt("-keypool=<n>", strprintf(_("Set key pool size to <n> (default: %u)"), 100)); | |||
if (showDebug) | |||
strUsage += HelpMessageOpt("-mintxfee=<amt>", strprintf("Fees (in BTC/Kb) smaller than this are considered zero fee for transaction creation (default: %s)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least fix Kb to kb here at the same time..
@theochino XBT is not a well-defined denomination. Different parts of the community use it for different size bases. |
Also, as to the concept of this PR itself: I don't think we need to define a variable for every reused term. Just changing "btc" and "bitcoins" to "BTC" in literals should be sufficient. |
253cc3f
to
520f8f5
Compare
Fixed kilobyte units, and removed the constant string. |
Just realised these strings are all copied into qt/bitcoinstrings.cpp - are those extracted automatically and I shouldn't touch them, or do they need updating too? |
Concept ACK on moving the currency unit to a constant.
Don't touch the file manually. Translation strings are extracted automatically by |
This only seems to cover core code, any reason not to do this for the GUI part? |
@Diapolo Couldn't see any problems in the QT code, apart from the bitcoinstrings.cpp (which are generated), and that code uses its own copy of currency units generally. Do let me know if I've missed anything. |
Hm, you removed the parametrization? |
Putting it back at the moment |
Done - let me know if that's okay and I'll squash them |
case mBTC: return QString("mBTC"); | ||
case uBTC: return QString::fromUtf8("μBTC"); | ||
case BTC: return QString(CURRENCY_UNIT.c_str()); | ||
case mBTC: return QString(("m" + CURRENCY_UNIT).c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you test this? const char * + const char * is going to be a pointer to some undefined memory...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's std::string + std::string I believe, and certainly seemed to work. Removing as per @laanwj 's request anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer relevant here, but for next time: you can use QString::fromStdString to convert a std::string to QString. No need for c_str.
b4a7b78
to
2c9c69a
Compare
Fixed, and found a couple of uses of "bitcoin" as a unit too, which I've also fixed. Thanks for the tip re: QString |
@@ -264,7 +264,7 @@ UniValue getmininginfo(const UniValue& params, bool fHelp) | |||
} | |||
|
|||
|
|||
// NOTE: Unlike wallet RPC (which use BTC values), mining RPCs follow GBT (BIP 22) in using satoshi amounts | |||
// NOTE: Unlike wallet RPC (which use " + CURRENCY_UNIT + " values), mining RPCs follow GBT (BIP 22) in using satoshi amounts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment :)
Previously various user-facing strings have used inconsistent currency units "BTC", "btc" and "bitcoins". This adds a single constant and uses it for each reference to the currency unit. Also adds a description of the unit for --maxtxfee, and adds the missing "amount" field description to the (deprecated) move RPC command.
Tested ACK (but please remove the runaway unit parametrization from the comment) |
2c9c69a
to
9ca7857
Compare
Fixed and squashed |
9ca7857 Rationalize currency unit to "BTC" (Ross Nicoll)
@luke-jr (On your August 1st comment.) - In 3 letters ISO codes, BTC will never be accepted (even it is used today) by the power to be. I do prefer the BTC version until I read everything there was on ISO4217 and participated in the foundation working group - https://en.wikipedia.org/wiki/ISO_4217 Once I read it, X (Supranational) BT (Bitcoin) makes more scene than BTC which belong to Bhutan. Just saying. XBT is free in the ISO code nomenclature. Why not claim it. |
"XBT" is fine as a symbol. My point is that it is not well-defined whether it represents 100,000,000 (BTC), 100,000 (mBTC), 100 (µBTC), or whatever else. |
I see your point ... leave it as BTC now and wait ... maybe later 1 XBT = 1 µBTC. To avoid headaches, I use 1 BTC = 1 XBT, 100'000 mBTC = 100'000 mXBT, and 100 µBTC = 100 µXBT and leave the fixing of the social ill to the pope. ISO standard has a field for the decimal (and I believe it does go to 8) so it would be a "trivial" change to use 1 BTC = 1 XBT which makes it simpler in the code to replace. If the amount changes in the future, we'll change it to something else when we cross that bridge. Anyway, it was a small "loaded" request .... |
Unifying the currency names across the source code to a single constant is
useful on itself, regardless of what people think that constant should be.
|
Revert before merging bitcoin/bitcoin#6504.
Rationalize currency unit to "ZEC" Cherry-picked from the upstream PR bitcoin/bitcoin#6504 Part of #2074
Previously various user-facing strings have used inconsistent currency units "BTC", "btc" and "bitcoins". This adds a single constant and uses it for each reference to the currency unit.
Also adds a description of the unit for --maxtxfee, and adds the missing "amount" field description to the (deprecated) move RPC command.