mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-24 13:45:37 +03:00
Added FormatPrice utility function
This commit is contained in:
parent
c8e5c0ca5a
commit
916d9afdc9
@ -59,5 +59,26 @@ public static uint FromDateTime( DateTime dt )
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal static string FormatPrice(string currency, ulong price)
|
||||
{
|
||||
var decimaled = (price / 100.0).ToString("0.00");
|
||||
|
||||
switch (currency )
|
||||
{
|
||||
case "GBP": return $"£{decimaled}";
|
||||
case "USD": return $"${decimaled}";
|
||||
case "CAD": return $"${decimaled} CAD";
|
||||
case "EUR": return $"€{decimaled}";
|
||||
case "RUB": return $"₽{decimaled}";
|
||||
case "NZD": return $"${decimaled} NZD";
|
||||
|
||||
// TODO - all of them
|
||||
|
||||
default: return $"{decimaled}{currency}";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user