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)
3535 Context = context ;
3636 _settings = context . API . LoadSettingJsonStorage < Settings > ( ) ;
3737 _viewModel = new SettingsViewModel ( _settings ) ;
38-
38+
3939 MagesEngine = new Engine ( new Configuration
4040 {
4141 Scope = new Dictionary < string , object >
@@ -54,7 +54,19 @@ public List<Result> Query(Query query)
5454
5555 try
5656 {
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+
5870 var result = MagesEngine . Interpret ( expression ) ;
5971
6072 if ( result ? . ToString ( ) == "NaN" )
@@ -76,6 +88,7 @@ public List<Result> Query(Query query)
7688 IcoPath = "Images/calculator.png" ,
7789 Score = 300 ,
7890 SubTitle = Context . API . GetTranslation ( "flowlauncher_plugin_calculator_copy_number_to_clipboard" ) ,
91+ CopyText = newResult ,
7992 Action = c =>
8093 {
8194 try
You can’t perform that action at this time.
0 commit comments