Advertisement
Guest User

interpolation (C# Shell App Paste)

a guest
Dec 5th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
  2. using System;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Collections.Generic;
  6. using System.Globalization;
  7.  
  8. namespace CSharp_Shell
  9. {
  10.  
  11.     public static class Program
  12.     {
  13.         public static void Main()
  14.         {
  15.            double balance = 123.45;
  16.            string message = $"us balance: {balance:C}";
  17.            FormattableString message2 = $"us balance 2: {balance:C}";
  18.            CultureInfo provider = new CultureInfo("en-US");
  19.            Console.WriteLine(message.ToString(provider));
  20.            Console.WriteLine(message2.ToString(provider));
  21.            Console.ReadLine();
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement