mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use decimal separator in setting for query
This commit is contained in:
parent
d1c69d601b
commit
4b09e07e09
1 changed files with 15 additions and 2 deletions
|
|
@ -54,7 +54,19 @@ namespace Flow.Launcher.Plugin.Caculator
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var expression = query.Search.Replace(",", ".");
|
string expression;
|
||||||
|
|
||||||
|
switch (_settings.DecimalSeparator)
|
||||||
|
{
|
||||||
|
case DecimalSeparator.Comma:
|
||||||
|
case DecimalSeparator.UseSystemLocale when CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == ",":
|
||||||
|
expression = query.Search.Replace(".", ",");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
expression = query.Search;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
var result = MagesEngine.Interpret(expression);
|
var result = MagesEngine.Interpret(expression);
|
||||||
|
|
||||||
if (result?.ToString() == "NaN")
|
if (result?.ToString() == "NaN")
|
||||||
|
|
@ -76,6 +88,7 @@ namespace Flow.Launcher.Plugin.Caculator
|
||||||
IcoPath = "Images/calculator.png",
|
IcoPath = "Images/calculator.png",
|
||||||
Score = 300,
|
Score = 300,
|
||||||
SubTitle = Context.API.GetTranslation("flowlauncher_plugin_calculator_copy_number_to_clipboard"),
|
SubTitle = Context.API.GetTranslation("flowlauncher_plugin_calculator_copy_number_to_clipboard"),
|
||||||
|
CopyText = newResult,
|
||||||
Action = c =>
|
Action = c =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue