fbpx
× Share your code snippets, screen shots etc. here

Interpolated Strings

More
3 months 1 week ago #21 by wriedmann
Replied by wriedmann on topic Interpolated Strings
Hi,

this is really great:
local nValue as decimal
nValue := 123.45m	
Console.WriteLine( i"nValue: {nValue:######.0000}" ) // nValue: 123,4500
Console.WriteLine( i"nValue {nValue:F6}" )  // nValue: 123,450000

even if the .NET formatting strings are less powerful than the pictures we know from VO.

Wolfgang

P.S. I have also adjusted the wiki: docs.xsharp.it/doku.php?id=strings

Please Log in or Create an account to join the conversation.

More
3 months 1 week ago #22 by MathiasHakansson
Replied by MathiasHakansson on topic Interpolated Strings
Yes, Wolfgang, it's really convenient.

I find the .net formatting strings is less useful for numbers than VO's when it comes to common numbers and amounts. The formatting in .net however covers a wider field (like hex-values). I think the date formatting in .net is easier with all the standard formats that are ready to use.

docs.microsoft.com/en-us/dotnet/standard...meric-format-strings

/Mathias

Please Log in or Create an account to join the conversation.

More
3 months 1 week ago - 3 months 1 week ago #23 by wriedmann
Replied by wriedmann on topic Interpolated Strings
Hi Mathias,

yes, I find the options for numeric less useful than the picture strings in VO. And after all, input of numerics is very important in any business application.

But I see not why the picture clauses in the X# runtime could not be extended by the development team when we need that.

Wolfgang
Last edit: 3 months 1 week ago by wriedmann.

Please Log in or Create an account to join the conversation.