• Rob (unregistered)

    TRWTF is not allowing "#0.## \u2030" like in Java.

  • A.N.O Nymos (unregistered)

    This looks like they're trying to set-up an interpolated string (i.e.: $"{0:#,##0.00;(#,##0.00)}", which would just result in "0.00;(0.00)"). But as far as I know, you can't use interpolated strings like this:

    string str = $"{myfield.DataFormatString}"; //Won't work, or at least won't print "0.00;(0.00)"
    

    But maybe this isn't C#, and it works just fine in whatever language they're using.

  • (nodebb)

    If you're typing it frequently, you can use Option+Shift+R to type ‰ on macOS. But let's be honest, 99.999% of people (or 999.99‰ of people?) aren't typing it frequently and are going to have to google it, like I did just now.

  • (nodebb) in reply to A.N.O Nymos

    It's probably C# and I doubt they're trying to use the $ syntax. IMO more likely it's like this:

    myField.DataFormatString = "{0:#,##0. ... }";  // assume this a valid format string.
    ...
    // much later elsewhere in the code
    myTextBox.Text = String.Format (Myfield.DataFormatString, myField.Value);
    

    And you're correct about the $ syntax. MSFT says only works with a literal string. It's a compile-time transformation into formatting calls. See the first sentence here: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/tokens/interpolated

Leave a comment on “Readable Formats”

Log In or post as a guest

Replying to comment #705586:

« Return to Article