Skip to content

Conversation

@mbkma
Copy link
Member

@mbkma mbkma commented Aug 14, 2025

Now mate-calc supports both period (.) and comma (,) as decimal separators.

fixes #34

@mbkma mbkma requested a review from a team August 14, 2025 20:52
Copy link

@luigifab luigifab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without the PR with french locale with mate-calc 1.26 debian

  • 1.5+2 (decimal = numeric keypad)
  • 1.5+2 (decimal = point/dot)
  • 1,5+2 (decimal = coma)
image

Without the PR with french locale with mate-calc 1.28 fedora

  • 1.5+2 (decimal = numeric keypad)
  • 1,5+2 (decimal = coma)
  • 1.5+2 (decimal = point/dot)
image

Without the PR with c locale with mate-calc 1.26 debian & 1.28 fedora

  • 1.5+2 (decimal = numeric keypad)
  • 1,5+2 (decimal = coma)
image

With the PR with c locale it's working by rebuilding Debian 1.26 source package:

  • 1.5+2 (decimal = numeric keypad)
  • 1,5+2 (decimal = coma)
image

but when I press the coma, I have a warning:

fabrice@mario:~$ LC_ALL=c mate-calc

(process:6353): Gtk-WARNING **: 10:26:47.061: Locale not supported by C library.
	Using the fallback 'C' locale.

(mate-calc:6353): Gtk-WARNING **: 10:26:48.358: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
You can apply tags and insert marks without invalidating your iterators,
but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
will invalidate all outstanding iterators

@mbkma
Copy link
Member Author

mbkma commented Aug 15, 2025

warning fixed

Copy link
Member

@vkareh vkareh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work properly for me. Running as LANG=fr_FR mate-calc:

  • ✔️ if I type 123,456+1 the result is 124,456
  • ❌ if I type 123.456+1 I expect the result to be 123.457, but it's the same as the previous one: 124,456, which is incorrect in both result and display...

I think this PR should take into account the locale, rather than just accepting a comma arbitrarily.

…eriod (.) and comma (,) as decimal separators.
@mbkma mbkma changed the title The comma decimal separator support has been implemented successfully… Configurable separator support Dec 29, 2025
@github-actions
Copy link

🔍 Static Analysis Results

Code analysis completed for this pull request.

  • Scan-build reports: 1 files generated
  • Status: ⚠️ Issues found

The detailed reports are available in the workflow artifacts.

@mbkma mbkma requested review from a team and vkareh December 30, 2025 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for both , and . separators

4 participants