﻿{"id":435,"date":"2017-11-30T00:00:00","date_gmt":"2017-11-30T00:00:00","guid":{"rendered":"http:\/\/www.eyurtsever.com\/?p=435"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"parayi-yaziya-cevirmek-asp-netc","status":"publish","type":"post","link":"https:\/\/www.eyurtsever.com\/index.php\/parayi-yaziya-cevirmek-asp-netc","title":{"rendered":"Paray\u0131 Yaz\u0131ya \u00c7evirmek ASP.NET(C#)"},"content":{"rendered":"<p>Para birimini yaz\u0131ya \u00e7evirmek i\u00e7in a\u015fa\u011f\u0131daki kodlar\u0131 kullanabilirsiniz.<br \/>\n\u00c7\u0131kt\u0131s\u0131 \u015fu \u015fekilde olacakt\u0131r.<br \/>\n146,50 TL = Y\u00dcZKIRKALTI T\u00dcRK L\u0130RASI ELL\u0130 KURU\u015e<br \/>\n&nbsp;<br \/>\nKodlar<br \/>\n&nbsp;<\/p>\n<pre class=\"brush:vb\">\nprivate string yaziyaCevir(decimal tutar)\n{\nstring sTutar = tutar.ToString(\"F2\").Replace('.', ','); \/\/ Replace('.',',') ondal\u0131k ayrac\u0131n\u0131n . olma durumu i\u00e7in\nstring lira = sTutar.Substring(0, sTutar.IndexOf(',')); \/\/tutar\u0131n tam k\u0131sm\u0131\nstring kurus = sTutar.Substring(sTutar.IndexOf(',') + 1, 2);\nstring yazi = \"\";\nstring[] birler = { \"\", \"B\u0130R\", \"\u0130K\u0130\", \"\u00dc\u00e7\", \"D\u00d6RT\", \"BE\u015e\", \"ALTI\", \"YED\u0130\", \"SEK\u0130Z\", \"DOKUZ\" };\nstring[] onlar = { \"\", \"ON\", \"Y\u0130RM\u0130\", \"OTUZ\", \"KIRK\", \"ELL\u0130\", \"ALTMI\u015e\", \"YETM\u0130\u015e\", \"SEKSEN\", \"DOKSAN\" };\nstring[] binler = { \"KATR\u0130LYON\", \"TR\u0130LYON\", \"M\u0130LYAR\", \"M\u0130LYON\", \"B\u0130N\", \"\" }; \/\/KATR\u0130LYON'un \u00f6n\u00fcne ekleme yap\u0131larak art\u0131rabilir.\nint grupSayisi = 6; \/\/say\u0131daki 3'l\u00fc grup say\u0131s\u0131. katrilyon i\u00e7i 6. (1.234,00 daki grup say\u0131s\u0131 2'dir.)\n\/\/KATR\u0130LYON'un ba\u015f\u0131na ekleyece\u011finiz her de\u011fer i\u00e7in grup say\u0131s\u0131n\u0131 art\u0131r\u0131n\u0131z.\nlira = lira.PadLeft(grupSayisi * 3, '0'); \/\/say\u0131n\u0131n soluna '0' eklenerek say\u0131 'grup say\u0131s\u0131 x 3' basakmakl\u0131 yap\u0131l\u0131yor.\nstring grupDegeri;\nfor (int i = 0; i &lt; grupSayisi * 3; i += 3) \/\/say\u0131 3'erli gruplar halinde ele al\u0131n\u0131yor.\n{\ngrupDegeri = \"\";\nif (lira.Substring(i, 1) != \"0\")\ngrupDegeri += birler[Convert.ToInt32(lira.Substring(i, 1))] + \"Y\u00dcZ\"; \/\/y\u00fczler\nif (grupDegeri == \"B\u0130RY\u00dcZ\") \/\/biry\u00fcz d\u00fczeltiliyor.\ngrupDegeri = \"Y\u00dcZ\";\ngrupDegeri += onlar[Convert.ToInt32(lira.Substring(i + 1, 1))]; \/\/onlar\ngrupDegeri += birler[Convert.ToInt32(lira.Substring(i + 2, 1))]; \/\/birler\nif (grupDegeri != \"\") \/\/binler\ngrupDegeri += binler[i \/ 3];\nif (grupDegeri == \"B\u0130RB\u0130N\") \/\/birbin d\u00fczeltiliyor.\ngrupDegeri = \"B\u0130N\";\nyazi += grupDegeri;\n}\nif (yazi != \"\")\nyazi += \" T\u00dcRK L\u0130RASI \";\nint yaziUzunlugu = yazi.Length;\nif (kurus.Substring(0, 1) != \"0\") \/\/kuru\u015f onlar\nyazi += onlar[Convert.ToInt32(kurus.Substring(0, 1))];\nif (kurus.Substring(1, 1) != \"0\") \/\/kuru\u015f birler\nyazi += birler[Convert.ToInt32(kurus.Substring(1, 1))];\nif (yazi.Length &gt; yaziUzunlugu)\nyazi += \" KURU\u015e\";\nelse\nyazi += \"SIFIR KURU\u015e\";\nreturn yazi;\n}\n<\/pre>\n<p>kaynak : hayatisahin.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Para birimini yaz\u0131ya \u00e7evirmek i\u00e7in a\u015fa\u011f\u0131daki kodlar\u0131 kullanabilirsiniz. \u00c7\u0131kt\u0131s\u0131 \u015fu \u015fekilde olacakt\u0131r. 146,50 TL = Y\u00dcZKIRKALTI T\u00dcRK L\u0130RASI ELL\u0130 KURU\u015e &nbsp; Kodlar &nbsp; private string yaziyaCevir(decimal tutar) { string sTutar = tutar.ToString(&#8220;F2&#8221;).Replace(&#8216;.&#8217;, &#8216;,&#8217;); \/\/ Replace(&#8216;.&#8217;,&#8217;,&#8217;) ondal\u0131k ayrac\u0131n\u0131n . olma durumu i\u00e7in string lira = sTutar.Substring(0, sTutar.IndexOf(&#8216;,&#8217;)); \/\/tutar\u0131n tam k\u0131sm\u0131 string kurus = sTutar.Substring(sTutar.IndexOf(&#8216;,&#8217;) + 1, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,13],"tags":[222,223,280,375],"_links":{"self":[{"href":"https:\/\/www.eyurtsever.com\/index.php\/wp-json\/wp\/v2\/posts\/435"}],"collection":[{"href":"https:\/\/www.eyurtsever.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.eyurtsever.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.eyurtsever.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.eyurtsever.com\/index.php\/wp-json\/wp\/v2\/comments?post=435"}],"version-history":[{"count":0,"href":"https:\/\/www.eyurtsever.com\/index.php\/wp-json\/wp\/v2\/posts\/435\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.eyurtsever.com\/index.php\/wp-json\/wp\/v2\/media?parent=435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.eyurtsever.com\/index.php\/wp-json\/wp\/v2\/categories?post=435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.eyurtsever.com\/index.php\/wp-json\/wp\/v2\/tags?post=435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}