Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve on formatting issue #752 #753

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

TAKeanice
Copy link
Contributor

In the app there are crashes due to formatting issues.

Reason: Java placeholders (https://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax) as intended to be used by the OpenHab Sitemap specification (https://www.openhab.org/docs/configuration/items.html#state-presentation) were used in String.format in Swift, which uses the CString format specifiers (https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFStrings/formatSpecifiers.html).

The solution adds support for the %s format specifier. In the future, a java-placeholder-compatible format method should be introduced.

@TAKeanice TAKeanice force-pushed the 752-number_format_allow_strings branch 3 times, most recently from b24ad69 to f38a862 Compare February 24, 2024 15:12
@TAKeanice TAKeanice force-pushed the 752-number_format_allow_strings branch from f38a862 to c448ea7 Compare February 24, 2024 15:14
@TAKeanice TAKeanice changed the title fix formatting issues #752 Improve on formatting issue #752 Feb 24, 2024
@timbms
Copy link
Contributor

timbms commented Feb 29, 2024

@TAKeanice thank you for your bug fix! This is a great initiative.

Used the clamped function for Comparable

Signed-off-by: Tim Bert <[email protected]>
@timbms timbms merged commit 9d670eb into openhab:develop Feb 29, 2024
2 checks passed
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.

2 participants