Fix warnings and code cleanup/fixes (#13570)
This commit is contained in:
@@ -100,7 +100,7 @@ namespace Content.Shared.Localizations
|
||||
iargs[i - 2] = n;
|
||||
}
|
||||
|
||||
if (!ut!.TryGetUnit(max, out var mu))
|
||||
if (!ut.TryGetUnit(max, out var mu))
|
||||
throw new ArgumentException("Unit out of range for type");
|
||||
|
||||
var fargs = new object[iargs.Length];
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Content.Shared.Localizations
|
||||
{
|
||||
@@ -51,9 +52,9 @@ namespace Content.Shared.Localizations
|
||||
public string Format(double val)
|
||||
{
|
||||
if (TryGetUnit(val, out var w))
|
||||
return (val * w.Factor).ToString() + " " + Loc.GetString("units-" + w.Unit);
|
||||
return (val * w.Factor) + " " + Loc.GetString("units-" + w.Unit);
|
||||
|
||||
return val.ToString();
|
||||
return val.ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
public string Format(double val, string fmt)
|
||||
@@ -130,11 +131,11 @@ namespace Content.Shared.Localizations
|
||||
|
||||
public readonly static Dictionary<string, TypeTable> Types = new Dictionary<string, TypeTable>
|
||||
{
|
||||
["generic"] = Generic!,
|
||||
["pressure"] = Pressure!,
|
||||
["power"] = Power!,
|
||||
["energy"] = Energy!,
|
||||
["temperature"] = Temperature!
|
||||
["generic"] = Generic,
|
||||
["pressure"] = Pressure,
|
||||
["power"] = Power,
|
||||
["energy"] = Energy,
|
||||
["temperature"] = Temperature,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user