latin number support for kcalc

Ralf Habacker ralf.habacker at freenet.de
Wed Sep 24 11:07:18 CEST 2008


Hi,

My son is currently learning latin numbers in school and I have searched 
for a good desktop application which latin number support but found 
nothing really usable. Then I saw KCalc and tried to implement such 
support into because it looks easy to implement. I got it initial 
working by porting and integrating the javascript code from 
http://www.diaware.de/html/roemzahl.

The implementation isn't complete because I found are some issues in the 
frontend (should latin number buttons should always be displayed or only 
when in latin mode, how should the related buttons be grouped in the 
display [currently I took the 'c' and 'd' buttons from hex buttons] or 
should there be a general switch for it in the settings dialog)  and the 
backend: KCalc is based on numeric bases like 2,8,10,16. To integrate 
latin numbers I added a NB_LATIN enum with a value of 5 and patched the 
related parts in kcalcdisplay.cpp, kcalc.cpp and kcalc.ui. In fact latin 
numbers does not work like the other numeric bases.

Because not all latin numbers could be placed on every digit there is 
the need to display error messages after or while converting numbers 
and/or to forbid adding not allowed keys. I would say that KNumber has 
to be extended to import from and export to latin numbers but then 
KNumber probably has to be extended to support error signals and/or 
returning error codes and/or error messages.

If there is interest to have latin number support feel free to use the 
appended patch as a base.

Regards
 Ralf







-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kcalc-latin-numbers.patch
Url: http://mail.kde.org/pipermail/kde-utils-devel/attachments/20080924/84e96ac0/attachment-0001.bat 


More information about the Kde-utils-devel mailing list