首页 > 解决方案 > How to write Numbers With Commas?

问题描述

Sometimes in C++ I want to use large number like 1000000 and it's confusing. How can I use commas (if that is possible)?

For example I want this to work

int x = 1,000,000;

标签: c++numbers

解决方案


You an use the digit separator since c++14

int x = 1'000'000 

Does this work for you?


推荐阅读