Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1113093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:48:15+00:00 2026-05-17T02:48:15+00:00

These versions work as expected: <DataGridTextColumn Header=Total Units Binding={Binding TotalUnits, Mode=OneWay, StringFormat=N0}/> <TextBlock Text={Binding

  • 0

These versions work as expected:

<DataGridTextColumn Header="Total Units" Binding="{Binding TotalUnits, Mode=OneWay, StringFormat=N0}"/>

<TextBlock Text="{Binding TotalUnits, Mode=OneWay, StringFormat=N0}"/>

When I try it with a label, the StringFormat is iqnored and I get “123.000000” instead of “123”.

<Label Content="{Binding TotalUnits, Mode=OneWay, StringFormat=N0}"/>

TotalUnits is a Decimal.

So, what’s going on?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:48:15+00:00Added an answer on May 17, 2026 at 2:48 am

    Anything with a Content property has a special ContentStringFormat property you have to use rather than specifying the StringFormat in the Binding.

    Like this:

    <Window.Resources xmlns:sys="clr-namespace:System;assembly=mscorlib">
        <sys:Int16 x:Key="MyValue">100</sys:Int16>
    </Window.Resources>
    
    <StackPanel DataContext="{StaticResource MyValue}">
    
        <!-- using Label -->
        <Label Content="{Binding}" ContentStringFormat="{}{0:C}" />
    
        <!-- using TextBlock-->
        <TextBlock Text="{Binding, StringFormat={0:C}}" />
    
    </StackPanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make this fragment work: Version History --------------- These are the versions
Are both of these versions OK or is one of them to prefer? #!/usr/bin/env
I have a problem with a function that doesn't work as expected since I
One version is short value = unchecked((short)0x8010); Other versions like below will not work,
On the page: http://rubyforge.org/frs/?group_id=167 There are stable versions (1.8.6 p26 being the latest), and
In previous versions of Excel there was a registry entry that you could create
Is there a way to get all versions of list item(s) using a CAML
When there were duplicate JARs with different versions, the behavior was very inconsistent. Does
Is there a way to add earlier versions of iphone os in xcode 3.1.2,
In previous versions of Play 2.0 there was the Secure Module to do authorization.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.