{"id":183,"date":"2015-06-25T07:32:13","date_gmt":"2015-06-25T05:32:13","guid":{"rendered":"http:\/\/www.joergbayerlein.de\/?page_id=183"},"modified":"2015-06-25T07:44:20","modified_gmt":"2015-06-25T05:44:20","slug":"c-miniprojects","status":"publish","type":"page","link":"https:\/\/www.joergbayerlein.de\/?page_id=183","title":{"rendered":"C# Miniprojects"},"content":{"rendered":"<p><a href=\"https:\/\/www.joergbayerlein.de\/wp-content\/uploads\/2015\/06\/DigiClock.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-121\" src=\"https:\/\/www.joergbayerlein.de\/wp-content\/uploads\/2015\/06\/DigiClock.jpg\" alt=\"DigiClock\" width=\"150\" height=\"57\" \/><\/a><strong>1.DigiClock<\/strong><\/p>\n<p>First Miniproject is my digital clock with transparent background. See the <a href=\"https:\/\/www.joergbayerlein.de\/wp-content\/uploads\/2015\/06\/DigiUhrBay.zip\">sourcecode and exec- file here<\/a>. After start of the exe- file go with mouse <a href=\"https:\/\/www.joergbayerlein.de\/wp-content\/uploads\/2015\/06\/DigiClockWithPU.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-186\" src=\"https:\/\/www.joergbayerlein.de\/wp-content\/uploads\/2015\/06\/DigiClockWithPU-300x218.jpg\" alt=\"DigiClockWithPU\" width=\"173\" height=\"125\" srcset=\"https:\/\/www.joergbayerlein.de\/wp-content\/uploads\/2015\/06\/DigiClockWithPU-300x218.jpg 300w, https:\/\/www.joergbayerlein.de\/wp-content\/uploads\/2015\/06\/DigiClockWithPU.jpg 346w\" sizes=\"auto, (max-width: 173px) 100vw, 173px\" \/><\/a>over a number and with right click open the popup menu. There you can define the display \/ content, select &#8222;stay on top&#8220; or close application. If you click with left mouse button on a digit you can shift and change position.<\/p>\n<p><strong>2. Comma problem<\/strong><\/p>\n<p>In many C# application I have to convert ASCII &#8211; text in a textbox into floating point numbers. DotNet offers some conversion functions like &#8222;Convert.ToDouble&#8220; or &#8222;Double.TryParse&#8220;, but both functions use the separators defined in the Windows of the used PC. If you exchage textfiles with these numbers between different PCs then it could happen, that a german textfile with comma as decimal separator is read by a US &#8211; PC with dot as separator. Then this caused reading errors. In my function &#8222;ConvertToDouble(xyz.Text, ref h1)&#8220; it first tests, which sign is used as separator. Then the wrong separator is replaced by the correct one. This works also together with used thousand- separators. The only problem is the use of only one separator in a number. Then this is read as a decimal separator.\u00a0 Examples:<br \/>\n1,000,000.00 is read as one million<br \/>\n1.000.000,00 is also read as one million<br \/>\n1.000 and 1,000 are both read as one<br \/>\nUse this <a href=\"https:\/\/www.joergbayerlein.de\/wp-content\/uploads\/2015\/06\/CodesnippetCommaProblemSource.txt\">code snippet<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.DigiClock First Miniproject is my digital clock with transparent background. See the sourcecode and exec- file here. After start of the exe- file go with mouse over a number and with right click open the popup menu. There you can define the display \/ content, select &#8222;stay on top&#8220; or close application. If you click [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":114,"menu_order":4,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-183","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.joergbayerlein.de\/index.php?rest_route=\/wp\/v2\/pages\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.joergbayerlein.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.joergbayerlein.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.joergbayerlein.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joergbayerlein.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=183"}],"version-history":[{"count":5,"href":"https:\/\/www.joergbayerlein.de\/index.php?rest_route=\/wp\/v2\/pages\/183\/revisions"}],"predecessor-version":[{"id":189,"href":"https:\/\/www.joergbayerlein.de\/index.php?rest_route=\/wp\/v2\/pages\/183\/revisions\/189"}],"up":[{"embeddable":true,"href":"https:\/\/www.joergbayerlein.de\/index.php?rest_route=\/wp\/v2\/pages\/114"}],"wp:attachment":[{"href":"https:\/\/www.joergbayerlein.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}