Just Your Average Geek

Currently nuts about Javascript, C# and Patterns

  • HOME
  • About

Posts Tagged ‘ leading ’

Converting a negative Integer to String with leading zeros

  • January 20th, 2011
  • Posted in C#
  • By Michel van der Weide

Quick post for today. While doing some refactoring I ran into the following code which was intended to convert a negative integer to a string with leading zeros. int value = GetValue(); string val = "-" + (value * -1).ToString().PadLeft(2, '0'); This can be done much easier. And it works for positive and negative integers. [ READ MORE ]

Just your average geek?

Welcome to my blog.

This blog will mainly be used to tell you about all the nice things I learn in daily life which I want to share with all of you. Of course this will be about coding. C# code and Javascript, because that is what I am currently nuts about.

Read more about the author on the about page.
RSS FEED

Recent entry

  • 2011-03-04
  • Property changed event on Javascript objects.
  • 2011-01-20
  • Converting a negative Integer to String with leading zeros
  • 2011-01-02
  • Hierarchical Ordering – Dependency Walker
  • 2010-03-18
  • ComVisible class with a non ComVisible baseclass
  • 2010-03-04
  • Winforms with a WebBrowserControl, Fun with ObjectForScripting

Archive

  • March 2011
  • January 2011
  • March 2010
  • February 2010
  • January 2010
  • September 2009
  • July 2009

Category

  • C#
  • ExtAppBuilder
  • ExtJS
  • JavaScript
  • Patterns
  • WinForms
  • Copyright © 2010 Just Your Average Geek
  • Theme designed by mono-lab
  • Powerd by WordPress