mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 20:27:36 +02:00
Adjusting to force all instances to use rounded vs result due to Mage's quirks (#7164)
This commit is contained in:
@@ -41,7 +41,7 @@ namespace Microsoft.Plugin.Calculator
|
||||
}
|
||||
|
||||
var decimalResult = Convert.ToDecimal(result, cultureInfo);
|
||||
var roundedResult = Math.Round(decimalResult, RoundingDigits, MidpointRounding.AwayFromZero);
|
||||
var roundedResult = Round(decimalResult);
|
||||
|
||||
return new CalculateResult()
|
||||
{
|
||||
@@ -50,6 +50,11 @@ namespace Microsoft.Plugin.Calculator
|
||||
};
|
||||
}
|
||||
|
||||
public static decimal Round(decimal value)
|
||||
{
|
||||
return Math.Round(value, RoundingDigits, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
|
||||
private static object TransformResult(object result)
|
||||
{
|
||||
if (result.ToString() == "NaN")
|
||||
|
||||
Reference in New Issue
Block a user