fbpx
Welcome, Guest
Username: Password: Remember me
Share your code snippets, screen shots etc. here
  • Page:
  • 1
  • 2

TOPIC: Interpolated Strings

Interpolated Strings 5 months 3 weeks ago #21

  • wriedmann
  • wriedmann's Avatar
  • Away
  • Posts: 1340
  • Karma: 6
  • Thank you received: 6
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.

Interpolated Strings 5 months 3 weeks ago #22

  • MathiasHakansson
  • MathiasHakansson's Avatar
  • Offline
  • Posts: 33
  • Thank you received: 0
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.

Interpolated Strings 5 months 3 weeks ago #23

  • wriedmann
  • wriedmann's Avatar
  • Away
  • Posts: 1340
  • Karma: 6
  • Thank you received: 6
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

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

Last edit: by wriedmann.
  • Page:
  • 1
  • 2