Skip to content

Commit

Permalink
Rename df to formatter in C++ decimal formatting tutorial (#6153)
Browse files Browse the repository at this point in the history
  • Loading branch information
younies authored Feb 18, 2025
1 parent 5aa8c99 commit 03ec8ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tutorials/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ int main() {
DataProvider dp = DataProvider::create_compiled();

// Create a formatter object with the appropriate settings
DecimalFormatter df = DecimalFormatter::create_with_grouping_strategy(
DecimalFormatter formatter = DecimalFormatter::create_with_grouping_strategy(
dp, locale, DecimalGroupingStrategy::Auto).ok().value();

// Create a decimal representing the number 1,000,007
Decimal decimal = Decimal::create_from_u64(1000007);

// Format it to a string
std::string out = df.format(decimal).ok().value();
std::string out = formatter.format(decimal).ok().value();

// Report formatted value
std::cout << "Formatted value is " << out << std::endl;
Expand Down

0 comments on commit 03ec8ff

Please sign in to comment.