File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Plugins/Flow.Launcher.Plugin.Calculator Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public void Init(PluginInitContext context)
35
35
Context = context ;
36
36
_settings = context . API . LoadSettingJsonStorage < Settings > ( ) ;
37
37
_viewModel = new SettingsViewModel ( _settings ) ;
38
-
38
+
39
39
MagesEngine = new Engine ( new Configuration
40
40
{
41
41
Scope = new Dictionary < string , object >
@@ -54,7 +54,19 @@ public List<Result> Query(Query query)
54
54
55
55
try
56
56
{
57
- var expression = query . Search . Replace ( "," , "." ) ;
57
+ string expression ;
58
+
59
+ switch ( _settings . DecimalSeparator )
60
+ {
61
+ case DecimalSeparator . Comma :
62
+ case DecimalSeparator . UseSystemLocale when CultureInfo . CurrentCulture . NumberFormat . NumberDecimalSeparator == "," :
63
+ expression = query . Search . Replace ( "." , "," ) ;
64
+ break ;
65
+ default :
66
+ expression = query . Search ;
67
+ break ;
68
+ }
69
+
58
70
var result = MagesEngine . Interpret ( expression ) ;
59
71
60
72
if ( result ? . ToString ( ) == "NaN" )
@@ -76,6 +88,7 @@ public List<Result> Query(Query query)
76
88
IcoPath = "Images/calculator.png" ,
77
89
Score = 300 ,
78
90
SubTitle = Context . API . GetTranslation ( "flowlauncher_plugin_calculator_copy_number_to_clipboard" ) ,
91
+ CopyText = newResult ,
79
92
Action = c =>
80
93
{
81
94
try
You can’t perform that action at this time.
0 commit comments