Skip to main content
1 of 2
Caleth
  • 66.3k
  • 2
  • 53
  • 103

You can use the %Q conversion specifier.

std::println("duration: {:%Q} year(s)", duration);
Caleth
  • 66.3k
  • 2
  • 53
  • 103