---
title: "How to use stringformat in multibinding in WPF XAML"  
description: "How to use stringformat in multibinding in WPF XAML"  
author: "Anonymous User"  
published: 2013-09-24  
updated: 2013-09-24  
canonical: https://www.mindstick.com/forum/1511/how-to-use-stringformat-in-multibinding-in-wpf-xaml  
category: "c#"  
tags: ["c#", "use stringformat", "stringformat in multibinding", "wpf", "xaml", "mindstick", "stringformat in multibinding in WPF XAML"]  
reading_time: 1 minute  

---

# How to use stringformat in multibinding in WPF XAML

As you know StringFormat is of great [importance](https://www.mindstick.com/articles/13099/the-importance-of-machine-learning-service-providers) for [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) representation in [WPF](https://www.mindstick.com/forum/304/wpf). My [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is how to use StringFormat when multibinding in WPF?

If I give a very [simple](https://yourviews.mindstick.com/story/1469/5-simple-ways-to-stay-fit-amp-healthy) example:

We have [variables](https://www.mindstick.com/articles/715/php-variables),which are A and B and whose [values](https://www.mindstick.com/forum/327/sum-textbox-values) are 10.255555 and 25.6999999

And we want to show them 10.2,25.6?

How can I do this with multibinding? Normally it is piece of cake with ValueConverter

Any help and [ideas](https://www.mindstick.com/articles/43878/making-the-best-use-of-the-options-trade-ideas) on this [topic](https://answers.mindstick.com/blog/313/how-to-generate-content-on-a-topic-using-ml-dot-net) will be greately appreciated

## Replies

### Reply by Pravesh Singh

Hi Jeet,

Just set the StringFormat property on the MultiBinding; use placeholders ({0}, {1}...) for each binding in the multibinding, and include format specifiers if necessary (e.g. F1 for a decimal number with 1 decimal digit)

```
<TextBlock>    <TextBlock.Text>        <MultiBinding StringFormat="{}{0:F1}{1:F1}">            <Binding Path="A" />            <Binding Path="B" />        </MultiBinding>    </TextBlock.Text></TextBlock>
```

The {} part at the beginning is the format string is an escape sequence (otherwise the XAML parser would consider { to be the beginning of a markup extension)


---

Original Source: https://www.mindstick.com/forum/1511/how-to-use-stringformat-in-multibinding-in-wpf-xaml

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
