Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MSI Plessey Check digit calculation

MSI Plessey Check digit calculation

Scheduled Pinned Locked Moved C#
question
2 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wi_mohitmca
    wrote on last edited by
    #1

    am developing an windows application where i am using MSI plessey TTF font in this font i need to calculate check digit so how can i do that check digit calaculation

    D 1 Reply Last reply
    0
    • W wi_mohitmca

      am developing an windows application where i am using MSI plessey TTF font in this font i need to calculate check digit so how can i do that check digit calaculation

      D Offline
      D Offline
      D i x y
      wrote on last edited by
      #2

      private string msiplessey(string abc) { string value = ""; string values = ""; string adds = ""; string evenvalues = ""; string evenval = ""; string evenadds = ""; string resultadd = ""; string fval = ""; long add = 0; long abcd; long evenadd = 0; long result; int checkvalue = 0; int finalresult; for (int i = abc.Length - 1; i > -1; i -= 2) { value += abc.Substring(i, 1); } for (int j = value.Length - 1; j >= 0; j--) { values += value.Substring(j, 1); } abcd = (Convert.ToInt64(values) * 2); string oddvalue = abcd.ToString(); for (int k = 0; k < oddvalue.Length; k++) { adds = oddvalue.Substring(k, 1); add = add + Convert.ToInt64(adds); } for (int l = abc.Length - 2; l > -1; l -= 2) { evenvalues += abc.Substring(l, 1); } for (int m = evenvalues.Length - 1; m >= 0; m--) { evenval += evenvalues.Substring(m, 1); } for (int n = 0; n < evenval.Length; n++) { evenadds = evenval.Substring(n, 1); evenadd = evenadd + Convert.ToInt64(evenadds); } result = add + evenadd; resultadd = result.ToString(); finalresult = Convert.ToInt32(resultadd.Length); fval = resultadd.Substring(finalresult - 1); checkvalue = (10 - (Convert.ToInt32(fval))); if (checkvalue == 10) { checkvalue = 0; } else { checkvalue = (10 - (Convert.ToInt32(fval))); } return checkvalue.ToString(); }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups