# Inserting ints into a menu string

**URL:** <https://discourse.cataclysmdda.org/t/inserting-ints-into-a-menu-string/8875>\
**Category:** The Toolbox\
**Created:** [February 8, 2015, 10:47pm UTC](https://discourse.cataclysmdda.org/t/inserting-ints-into-a-menu-string/8875 "2015-02-08T22:47:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PropaneSoup](https://avatars.discourse-cdn.com/v4/letter/p/e19b73/32.png) [@PropaneSoup](https://discourse.cataclysmdda.org/u/PropaneSoup)\
**Post date:** [February 8, 2015, 10:47pm UTC](https://discourse.cataclysmdda.org/t/inserting-ints-into-a-menu-string/8875/1 "2015-02-08T22:47:19Z")

</div>

I’ve been working on my Clothing PR and I figured this was a better place to ask a question than my already long Github PR page. I’ve been trying to add a little note at the end of each menu option to show how much that stat would improve. I’ve got the idea down, I think, and my code compiles, but when I get to that menu, the game crashes. I tried looking around for a place this was already done, but the closest I could find was the install bionic query that shows you the percent chance of success, so I based it off of that.

` int choice = menu(true, _("How do you want to modify it?"), _("Add extra straps and pockets (+ %i storage)"),
                           _("Line it with fur (+ %i warmth)"),_("Pad with leather (+ %i resist)"),_("Line with kevlar (+ %i resist)"),_("Cancel"),
                          stor_mod, warm_mod, l_mod, k_mod);`

Is what I’m trying to do here even possible?

---

<div class="post-metadata">

**Author:** ![BevapDin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/bevapdin/32/228_2.png) [@BevapDin](https://discourse.cataclysmdda.org/u/BevapDin)\
**Post date:** [February 11, 2015, 2:58pm UTC](https://discourse.cataclysmdda.org/t/inserting-ints-into-a-menu-string/8875/2 "2015-02-11T14:58:11Z")

</div>

That simply won’t work. You can either use the [tt]uimenu[/tt] class directly like many other code (e.g. [tt]iuse::knife[/tt]), or create the strings with [tt]string\_format[/tt] and store them in temporary variables:

```auto
const auto opt0 = string_format( ... );
const auto opt1 = string_format( ... ); // Don't forget the translation here
int choice = menu(true, _("How do you want to modify it?"), opt0.c_str(), opt1.c_str());
```
