Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void Initialize()
[DataRow("=2^96", "Result value was either too large or too small for a decimal number")]
[DataRow("=+()", "Calculation result is not a valid number (NaN)")]
[DataRow("=[10,10]", "Unsupported use of square brackets")]
[DataRow("=sqrt(-1)", "Complex numbers are not supported")]
[DataRow("=5/0", "Expression contains division by zero")]
[DataRow("=5 / 0", "Expression contains division by zero")]
[DataRow("10+(8*9)/0+7", "Expression contains division by zero")]
Expand All @@ -63,6 +64,7 @@ public void ErrorResultOnInvalidKeywordQuery(string typedString, string expected
[DataRow("2^96")]
[DataRow("+()")]
[DataRow("[10,10]")]
[DataRow("sqrt(-1)")]
[DataRow("5/0")]
[DataRow("5 / 0")]
[DataRow("10+(8*9)/0+7")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Numerics;
using System.Text.RegularExpressions;

using Mages.Core;
Expand Down Expand Up @@ -122,6 +123,11 @@ private static dynamic TransformResult(object result)
return Properties.Resources.wox_plugin_calculator_double_array_returned;
}

if (result is Complex)
{
return Properties.Resources.wox_plugin_calculator_complex_number_returned;
}

return result;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@
<data name="wox_plugin_calculator_double_array_returned" xml:space="preserve">
<value>Unsupported use of square brackets</value>
</data>
<data name="wox_plugin_calculator_complex_number_returned" xml:space="preserve">
<value>Complex numbers are not supported</value>
</data>
<data name="wox_plugin_calculator_not_covert_to_decimal" xml:space="preserve">
<value>Result value was either too large or too small for a decimal number</value>
</data>
Expand Down Expand Up @@ -187,4 +190,4 @@
<value>Gradians</value>
<comment>Text for angle unit.</comment>
</data>
</root>
</root>
Loading