(by Codex) Keep bank overview totals and currency display in 64 bits
This commit is contained in:
1 parent
8baf80564a
commit
86e2bfd32a
8 files changed
+156
-38
No files matched your search
@@ -1174,3 +1174,7 @@ target_link_libraries(transfer_seller_app_tests PRIVATE bmhui openbmh_audio ${BM
|
||||
set(BMH_TEST_TRANSFER_SELLER_APP_SAVE "" CACHE FILEPATH "External career for seller-offer integration; not distributed")
|
||||
bmh_add_data_test(NAME transfer_seller_app_tests REQUIRED_OPTIONS BMH_TEST_TRANSFER_SELLER_APP_SAVE
|
||||
COMMAND transfer_seller_app_tests "${BMH_DATA}" "${BMH_TEST_TRANSFER_SELLER_APP_SAVE}")
|
||||
|
||||
add_executable(wide_number_unit_tests tests/wide_number_unit_tests.cpp)
|
||||
target_link_libraries(wide_number_unit_tests PRIVATE bmhcore)
|
||||
add_test(NAME wide_number_unit_tests COMMAND wide_number_unit_tests)
|
||||
@@ -98,3 +98,9 @@ retirement/refusal flags remain effective. The initial academy contract remains
|
||||
two years; a young arrival can immediately negotiate any supported renewal term.
|
||||
This corrects the reused-row mechanism; it does not establish a fixed 200–300
|
||||
season threshold or repair ambiguous refusal flags in existing saved careers.
|
||||
|
||||
Bank finance-overview totals and gains use 64-bit read-only projections and
|
||||
currency formatting, including values beyond a signed native account word.
|
||||
Saved cash, deposits, loan fields and holdings retain their original widths.
|
||||
This prevents a positive combined portfolio from appearing negative; it does
|
||||
not recover amounts that have already overflowed inside a native saved field.
|
||||
+44
-9
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <limits>
|
||||
|
||||
namespace bmh {
|
||||
|
||||
@@ -113,13 +114,8 @@ std::string message_text_following(const GameState& g, uint32_t pointer_variable
|
||||
return text;
|
||||
}
|
||||
|
||||
std::string format_number(const GameState& g, int32_t value, int flags) {
|
||||
if (flags & 0x100) {
|
||||
// ConvertCurrency: currency conversion (1/1 unless the savegame says otherwise)
|
||||
const int32_t mul = g.memory.has(::bmh::layout::CurrencyMultiplier) ? int32_t(g.memory.u32(::bmh::layout::CurrencyMultiplier)) : 1;
|
||||
const int32_t div = g.memory.has(::bmh::layout::CurrencyDivisor) ? int32_t(g.memory.u32(::bmh::layout::CurrencyDivisor)) : 1;
|
||||
if (div != 0) value = value * mul / div;
|
||||
}
|
||||
namespace {
|
||||
std::string format_number_digits(const GameState& g, int64_t value, int flags) {
|
||||
// FormatGroupedDigits: digits from the right; with grouping (bit 0x40 clear) a dot before the
|
||||
// 4th, 8th and 12th character; padded to the width (bits 0-5), leading blanks for the
|
||||
// dots a wide field reserves
|
||||
@@ -127,12 +123,12 @@ std::string format_number(const GameState& g, int32_t value, int flags) {
|
||||
const int width = flags & 0x3F;
|
||||
int blanks = group && width > 3 ? (width - 4) / 3 + 1 : 0;
|
||||
const bool negative = value < 0;
|
||||
uint32_t v = negative ? uint32_t(-int64_t(value)) : uint32_t(value);
|
||||
uint64_t v = negative ? uint64_t(-(value + 1)) + 1 : uint64_t(value);
|
||||
std::string reversed;
|
||||
int dots = 0;
|
||||
while (v != 0) {
|
||||
const size_t n = reversed.size();
|
||||
if (group && (n == 3 || n == 7 || n == 11)) reversed.push_back('.'), blanks--, dots++;
|
||||
if (group && n % 4 == 3) reversed.push_back('.'), blanks--, dots++;
|
||||
reversed.push_back(char('0' + v % 10));
|
||||
v /= 10;
|
||||
}
|
||||
@@ -149,6 +145,45 @@ std::string format_number(const GameState& g, int32_t value, int flags) {
|
||||
return s;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
std::string format_number(const GameState& g, int32_t value, int flags) {
|
||||
if (flags & 0x100) {
|
||||
// ConvertCurrency: currency conversion (1/1 unless the savegame says otherwise)
|
||||
const int32_t mul = g.memory.has(::bmh::layout::CurrencyMultiplier) ? int32_t(g.memory.u32(::bmh::layout::CurrencyMultiplier)) : 1;
|
||||
const int32_t div = g.memory.has(::bmh::layout::CurrencyDivisor) ? int32_t(g.memory.u32(::bmh::layout::CurrencyDivisor)) : 1;
|
||||
if (div != 0) value = value * mul / div;
|
||||
}
|
||||
return format_number_digits(g, value, flags);
|
||||
}
|
||||
|
||||
std::string format_number_wide(const GameState& g, int64_t value, int flags) {
|
||||
if (flags & 0x100) {
|
||||
const int32_t mul = g.memory.has(layout::CurrencyMultiplier) ? int32_t(g.memory.u32(layout::CurrencyMultiplier)) : 1;
|
||||
const int32_t div = g.memory.has(layout::CurrencyDivisor) ? int32_t(g.memory.u32(layout::CurrencyDivisor)) : 1;
|
||||
if (div != 0) {
|
||||
const bool negative = (value < 0) != ((mul < 0) != (div < 0));
|
||||
const uint64_t magnitude = value < 0 ? uint64_t(-(value + 1)) + 1 : uint64_t(value);
|
||||
const uint64_t multiplier = mul < 0 ? uint64_t(-int64_t(mul)) : uint64_t(mul);
|
||||
const uint64_t divisor = div < 0 ? uint64_t(-int64_t(div)) : uint64_t(div);
|
||||
const uint64_t limit = uint64_t(std::numeric_limits<int64_t>::max()) + uint64_t(negative);
|
||||
// Split before multiplication, keeping exact truncation without
|
||||
// requiring nonportable 128-bit integers for currency conversion.
|
||||
const uint64_t whole = magnitude / divisor;
|
||||
if (multiplier && whole > limit / multiplier)
|
||||
throw FormatError("wide currency amount exceeds display range");
|
||||
const uint64_t base = whole * multiplier;
|
||||
const uint64_t fraction = (magnitude % divisor) * multiplier / divisor;
|
||||
if (fraction > limit - base)
|
||||
throw FormatError("wide currency amount exceeds display range");
|
||||
const uint64_t converted = base + fraction;
|
||||
value = negative ? (converted == uint64_t(std::numeric_limits<int64_t>::max()) + 1
|
||||
? std::numeric_limits<int64_t>::min() : -int64_t(converted)) : int64_t(converted);
|
||||
}
|
||||
}
|
||||
return format_number_digits(g, value, flags);
|
||||
}
|
||||
|
||||
std::string format_amount(const GameState& g, int32_t value) { return format_number(g, value, 0x101); }
|
||||
|
||||
void install_message_texts(const LeImage& exe) {
|
||||
|
||||
@@ -72,5 +72,7 @@ std::string format_amount(const GameState& g, int32_t value);
|
||||
// FormatNumber(buf, value, flags, ""): bits 0-5 the field width, bit 0x40 no dot grouping,
|
||||
// bit 0x100 an amount of money (converted, " EU" appended).
|
||||
std::string format_number(const GameState& g, int32_t value, int flags);
|
||||
// Read-only aggregates can exceed a native save word; preserve currency and padding.
|
||||
std::string format_number_wide(const GameState& g, int64_t value, int flags);
|
||||
|
||||
} // namespace bmh
|
||||
+23
-26
@@ -100,8 +100,8 @@ BankState bank_from_game(const GameState& g, const LeImage& exe, uint64_t revisi
|
||||
}
|
||||
state.credit_currency = {g.memory.has(::bmh::layout::CurrencyMultiplier) ? int32_t(g.memory.u32(::bmh::layout::CurrencyMultiplier)) : 1,
|
||||
g.memory.has(::bmh::layout::CurrencyDivisor) ? int32_t(g.memory.u32(::bmh::layout::CurrencyDivisor)) : 1};
|
||||
const auto currency = [&](int32_t amount, int flags) {
|
||||
std::string value = format_number(g, amount, flags);
|
||||
const auto currency = [&](int64_t amount, int flags) {
|
||||
std::string value = format_number_wide(g, amount, flags);
|
||||
// FormatNumber appends currency (CurrencySuffixText) and the caller's Bank_FormatError_ExecutableField suffix.
|
||||
value += exe.cstring(::bmh::layout::Bank_FormatError_ExecutableField);
|
||||
return original_to_utf8(value);
|
||||
@@ -141,8 +141,8 @@ BankState bank_from_game(const GameState& g, const LeImage& exe, uint64_t revisi
|
||||
fund.owned = g.memory.u16(at + 0x14 + uint32_t(manager) * 2);
|
||||
fund.max_to_buy = fund.price == 0 ? 0 : max_fund_units(g, manager, int(i));
|
||||
fund.name = original_to_utf8(message_text(g, ::bmh::layout::Bank_OriginalToUtf8_TextPointer3 + uint32_t(i) * 4));
|
||||
fund.unit_price_text = currency(wrap_i32(fund.price), 0x108);
|
||||
fund.average_paid_text = currency(fund.owned ? wrap_i32(fund.paid / fund.owned) : 0, 0x108);
|
||||
fund.unit_price_text = currency(fund.price, 0x108);
|
||||
fund.average_paid_text = currency(fund.owned ? fund.paid / fund.owned : 0, 0x108);
|
||||
fund.quantity_text = original_to_utf8(format_number(g, fund.owned, 0x82) + exe.cstring(::bmh::layout::Bank_OriginalToUtf8_ExecutableField2));
|
||||
fund.one_quantity_text = original_to_utf8(format_number(g, 1, 0x82) + exe.cstring(::bmh::layout::Bank_OriginalToUtf8_ExecutableField2));
|
||||
const uint32_t suffix = exe.u32(::bmh::layout::Bank_OriginalToUtf8_RuntimeField + uint32_t(i) * 8);
|
||||
@@ -154,49 +154,46 @@ BankState bank_from_game(const GameState& g, const LeImage& exe, uint64_t revisi
|
||||
// and the separate overdraft limit. All inputs are copied/read-only.
|
||||
state.finance_values[0] = state.balance;
|
||||
state.finance_values[1] = state.deposit;
|
||||
int32_t investment_value = 0, investment_gain = 0;
|
||||
// OpenBMH deviates from the original: read-only totals use wide arithmetic;
|
||||
// individual saved account, price, holding and paid fields are unchanged.
|
||||
int64_t investment_value = 0, investment_gain = 0;
|
||||
for (size_t i = 0; i < state.funds.size(); ++i) {
|
||||
const uint32_t price = g.memory.u32(::bmh::layout::FundBlock + uint32_t(i) * 0x1c);
|
||||
const uint32_t held = g.memory.u16(::bmh::layout::Advertising_OriginalShareAdjustment_RuntimeField + uint32_t(manager) * 2 + uint32_t(i) * 0x1c);
|
||||
const int32_t value = wrap_i32(price * held);
|
||||
investment_value = wrap_sum(investment_value, value);
|
||||
const int32_t paid = wrap_i32(g.memory.u32(::bmh::layout::Bank_OriginalToUtf8_RuntimeField5 + uint32_t(i) * 0x1c + uint32_t(manager) * 4));
|
||||
if (held) investment_gain = wrap_sum(investment_gain, wrap_i32(uint32_t(value) - uint32_t(paid)));
|
||||
const int64_t value = int64_t(price) * held;
|
||||
investment_value += value;
|
||||
const int64_t paid = g.memory.u32(::bmh::layout::Bank_OriginalToUtf8_RuntimeField5 + uint32_t(i) * 0x1c + uint32_t(manager) * 4);
|
||||
if (held) investment_gain += value - paid;
|
||||
}
|
||||
state.finance_values[2] = investment_value;
|
||||
state.finance_gains[0] = investment_gain;
|
||||
int32_t stock_value = 0, stock_gain = 0;
|
||||
int64_t stock_value = 0, stock_gain = 0;
|
||||
for (size_t i = 0; i < state.stocks.size(); ++i) {
|
||||
const int32_t value = wrap_i32(uint32_t(state.stocks[i].price) * state.stocks[i].owned);
|
||||
stock_value = wrap_sum(stock_value, value);
|
||||
if (state.stocks[i].owned) stock_gain = wrap_sum(stock_gain, wrap_i32(uint32_t(value) - uint32_t(state.stocks[i].paid)));
|
||||
const int64_t value = int64_t(state.stocks[i].price) * state.stocks[i].owned;
|
||||
stock_value += value;
|
||||
if (state.stocks[i].owned) stock_gain += value - state.stocks[i].paid;
|
||||
}
|
||||
state.finance_values[3] = stock_value;
|
||||
state.finance_gains[1] = stock_gain;
|
||||
int32_t debts = 0, debt_assets = 0;
|
||||
int64_t debts = 0, debt_assets = 0;
|
||||
for (uint32_t loan = 0; loan < 5; ++loan) {
|
||||
const uint32_t at = ::bmh::layout::Analytics_SourceAssetMaskE_RuntimeField + uint32_t(manager) * 0x78 + loan * 0x18;
|
||||
const uint32_t borrowed = g.memory.u32(at);
|
||||
const uint32_t repaid = g.memory.u32(at + 0x10);
|
||||
debts = wrap_sum(debts, wrap_i32(borrowed - repaid));
|
||||
debt_assets = wrap_sum(debt_assets, wrap_i32(borrowed));
|
||||
debts += int64_t(borrowed) - repaid;
|
||||
debt_assets += borrowed;
|
||||
}
|
||||
state.finance_values[4] = debts;
|
||||
int32_t net = state.balance;
|
||||
net = wrap_sum(net, state.deposit);
|
||||
net = wrap_sum(net, investment_value);
|
||||
net = wrap_sum(net, stock_value);
|
||||
net = wrap_sum(net, wrap_i32(0u - uint32_t(debt_assets)));
|
||||
state.finance_values[5] = net;
|
||||
state.finance_values[5] = int64_t(state.balance) + state.deposit + investment_value + stock_value - debt_assets;
|
||||
state.finance_values[6] = state.credit_line;
|
||||
for (size_t i = 0; i < state.finance_value_text.size(); ++i)
|
||||
state.finance_value_text[i] = currency(state.finance_values[i], 0x188);
|
||||
for (size_t i = 0; i < state.finance_gains.size(); ++i) {
|
||||
const int32_t gain = state.finance_gains[i];
|
||||
const int64_t gain = state.finance_gains[i];
|
||||
const uint32_t sign_address = gain < 0 ? ::bmh::layout::Bank_OriginalToUtf8_ExecutableField5 : gain > 0 ? ::bmh::layout::Bank_OriginalToUtf8_ExecutableField6 : ::bmh::layout::Bank_OriginalToUtf8_ExecutableField7;
|
||||
const int32_t magnitude = gain < 0 ? wrap_i32(0u - uint32_t(gain)) : gain;
|
||||
const int64_t magnitude = gain < 0 ? -gain : gain;
|
||||
state.finance_gain_text[i] = original_to_utf8(exe.cstring(sign_address) +
|
||||
format_number(g, magnitude, 0x101) + exe.cstring(::bmh::layout::Bank_OriginalToUtf8_ExecutableField3));
|
||||
format_number_wide(g, magnitude, 0x101) + exe.cstring(::bmh::layout::Bank_OriginalToUtf8_ExecutableField3));
|
||||
// 0x101 appends; Source preserves market value and adds signed gain in parentheses.
|
||||
if (state.finance_values[i + 2] != 0)
|
||||
state.finance_value_text[i + 2] += original_to_utf8(exe.cstring(::bmh::layout::Bank_OriginalToUtf8_ExecutableField4)) + state.finance_gain_text[i];
|
||||
@@ -226,7 +223,7 @@ BankState bank_from_game(const GameState& g, const LeImage& exe, uint64_t revisi
|
||||
state.finance_fund_labels[i] = original_to_utf8(format_number(g, fund.owned, 0x82) + exe.cstring(::bmh::layout::Bank_OriginalToUtf8_ExecutableField2) +
|
||||
message_text(g, ::bmh::layout::Bank_OriginalToUtf8_TextPointer3 + uint32_t(i) * 4) +
|
||||
exe.cstring(exe.u32(::bmh::layout::Bank_OriginalToUtf8_RuntimeField + uint32_t(i) * 8 + (fund.owned > 1 ? 4 : 0))));
|
||||
state.finance_fund_prices[i] = original_to_utf8("(" + format_number(g, wrap_i32(fund.price), 0x108) + exe.cstring(::bmh::layout::Bank_OriginalToUtf8_ExecutableField3));
|
||||
state.finance_fund_prices[i] = original_to_utf8("(" + format_number_wide(g, fund.price, 0x108) + exe.cstring(::bmh::layout::Bank_OriginalToUtf8_ExecutableField3));
|
||||
}
|
||||
for (size_t i = 0; i < state.stocks.size(); ++i) {
|
||||
const auto& stock = state.stocks[i];
|
||||
|
||||
+2
-2
@@ -28,8 +28,8 @@ struct BankState {
|
||||
std::string investment_limit_text;
|
||||
int manager_portrait = 0, badge_sprite = 0;
|
||||
// MaxSharesToBuy case 1: the seven read-only values shown in the finance view.
|
||||
std::array<int32_t, 7> finance_values{};
|
||||
std::array<int32_t, 2> finance_gains{};
|
||||
std::array<int64_t, 7> finance_values{};
|
||||
std::array<int64_t, 2> finance_gains{};
|
||||
std::array<std::string, 7> finance_value_text{};
|
||||
std::array<std::string, 2> finance_gain_text{};
|
||||
// Case 4 (bank credit) readonly values as seen before any local edits.
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "app/controller.hpp"
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/save.hpp"
|
||||
#include "game/messages.hpp"
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
@@ -45,6 +46,44 @@ int main(int argc,char** argv)try {
|
||||
session->game().seed()==game.seed()&&session->game().calls()==game.calls()&&
|
||||
session->rand().seed()==random.seed()&&session->rand().calls()==random.calls(),
|
||||
"opening calendars changed the career or random streams");
|
||||
std::cout<<"Edition career startup, original calendar/rescheduling navigation and dialog mode passed\n";
|
||||
auto finances=session->state();
|
||||
const int manager=int(finances.memory.u8(layout::ActiveManager));
|
||||
const size_t record=size_t(manager)*0xb0c;
|
||||
const auto record_money=[&](size_t offset,int32_t value) {
|
||||
for(int byte=0;byte<4;++byte)finances.manager_records.at(record+offset+byte)=uint8_t(uint32_t(value)>>(byte*8));
|
||||
};
|
||||
record_money(0x314,1500000000);record_money(0x318,1500000000);
|
||||
for(uint32_t i=0;i<6;++i) {
|
||||
finances.memory.set32(layout::FundBlock+i*0x1c,1000000);
|
||||
finances.memory.set16(layout::Advertising_OriginalShareAdjustment_RuntimeField+uint32_t(manager)*2+i*0x1c,i<2?1500:0);
|
||||
finances.memory.set32(layout::Bank_OriginalToUtf8_RuntimeField5+uint32_t(manager)*4+i*0x1c,0);
|
||||
}
|
||||
for(size_t i=0;i<12;++i) {
|
||||
const size_t at=i*0x5c;
|
||||
const uint16_t price=i==0?60000:1,held=i==0?50000:0;
|
||||
finances.stocks.at(at+0x4e)=uint8_t(price);finances.stocks.at(at+0x4f)=uint8_t(price>>8);
|
||||
finances.stocks.at(at+0x50+size_t(manager)*2)=uint8_t(held);
|
||||
finances.stocks.at(at+0x51+size_t(manager)*2)=uint8_t(held>>8);
|
||||
for(size_t byte=0;byte<4;++byte)finances.stocks.at(at+4+size_t(manager)*4+byte)=0;
|
||||
}
|
||||
for(uint32_t i=0;i<5;++i) {
|
||||
const uint32_t at=layout::Analytics_SourceAssetMaskE_RuntimeField+uint32_t(manager)*0x78+i*0x18;
|
||||
finances.memory.set32(at,i<2?1500000000:0);finances.memory.set32(at+0x10,0);
|
||||
}
|
||||
finances.memory.set32(layout::CurrencyMultiplier,1);finances.memory.set32(layout::CurrencyDivisor,1);
|
||||
const auto finance_native=save_stream(finances);
|
||||
const auto exe=load_le(asset_path(data,"BMH.exe"));
|
||||
const auto bank=bank_from_game(finances,exe,revision);
|
||||
check(bank.finance_values[2]==3000000000LL&&bank.finance_values[3]==3000000000LL&&
|
||||
bank.finance_values[4]==3000000000LL&&bank.finance_values[5]==6000000000LL&&
|
||||
bank.finance_gains[0]==3000000000LL&&bank.finance_gains[1]==3000000000LL,
|
||||
"bank display totals wrapped although individual saved amounts fit their native words");
|
||||
check(bank.finance_value_text[5].find("6.000.000.000")!=std::string::npos,
|
||||
"bank net worth text truncated its wide projection");
|
||||
check(save_stream(finances)==finance_native,"read-only bank totals changed the save representation");
|
||||
finances.memory.set32(layout::CurrencyMultiplier,2);finances.memory.set32(layout::CurrencyDivisor,3);
|
||||
check(bank_from_game(finances,exe,revision).finance_value_text[5].find("4.000.000.000")!=std::string::npos,
|
||||
"bank aggregate display uses the wrong native currency units");
|
||||
std::cout<<"Edition career startup, original calendar/rescheduling navigation, dialog mode and wide bank display passed\n";
|
||||
return 0;
|
||||
}catch(const std::exception& e){std::cerr<<e.what()<<'\n';return 1;}
|
||||
@@ -0,0 +1,35 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
#include "game/messages.hpp"
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
#include <stdexcept>
|
||||
|
||||
using namespace bmh;
|
||||
namespace { void check(bool ok,const char* why){if(!ok)throw std::runtime_error(why);} }
|
||||
int main()try {
|
||||
GameState state;state.currency_suffix=" EU";
|
||||
state.memory.add_block(layout::CurrencyMultiplier,8);
|
||||
state.memory.set32(layout::CurrencyMultiplier,1);state.memory.set32(layout::CurrencyDivisor,1);
|
||||
for(int32_t amount:{-1000000,-1,0,1,1234567})
|
||||
for(int flags:{0,1,8,0x44,0x82,0x101,0x108,0x188})
|
||||
check(format_number_wide(state,amount,flags)==format_number(state,amount,flags),
|
||||
"wide display changed ordinary grouping, padding or currency");
|
||||
check(format_number_wide(state,6300000000LL,0x101)=="6.300.000.000 EU","large positive aggregate wrapped");
|
||||
check(format_number_wide(state,-6300000000LL,0x101)=="-6.300.000.000 EU","large negative aggregate lost its sign");
|
||||
state.memory.set32(layout::CurrencyMultiplier,2);state.memory.set32(layout::CurrencyDivisor,3);
|
||||
check(format_number_wide(state,6300000000LL,0x101)=="4.200.000.000 EU","wide totals changed currency units");
|
||||
check(format_number_wide(state,-5,0x101)=="-3 EU","currency division stopped truncating toward zero");
|
||||
state.memory.set32(layout::CurrencyMultiplier,2);state.memory.set32(layout::CurrencyDivisor,2);
|
||||
check(format_number_wide(state,std::numeric_limits<int64_t>::max(),0x101)=="9.223.372.036.854.775.807 EU",
|
||||
"representable currency conversion overflowed its intermediate product");
|
||||
check(format_number_wide(state,std::numeric_limits<int64_t>::min(),0x101)=="-9.223.372.036.854.775.808 EU",
|
||||
"minimum signed display amount overflowed while taking its magnitude");
|
||||
state.currency_suffix=" &";
|
||||
check(format_number_wide(state,3000000000LL,0x101)=="& 3.000.000.000","English currency prefix changed");
|
||||
state.memory.set32(layout::CurrencyDivisor,1);
|
||||
bool rejected=false;
|
||||
try{(void)format_number_wide(state,std::numeric_limits<int64_t>::max(),0x101);}catch(const FormatError&){rejected=true;}
|
||||
check(rejected,"unrepresentable currency output was silently clamped or wrapped");
|
||||
std::cout<<"Wide aggregate formatting, native parity, currency scaling and signed boundaries passed\n";
|
||||
return 0;
|
||||
}catch(const std::exception& e){std::cerr<<e.what()<<'\n';return 1;}
|
||||
Reference in new issue
Block a user