Set Negative and Zero Formatting in String.Format

Apart from setting the format you want the string to be shown, the format parameter in the String.Format method also allows to pass the negative formatting and zero formatting.

First is an example of the normal usage of this method:

String.Format(“{0:€ #,###.##}”, price);

To include the negative formatting add the following:

String.Format(“{0:€ #,###.##; (€ #,###.##)}”, price);

To include both the negative and zero formatting:

Continue reading

Advertisements

Remove Special Characters (like !, %, &, #) from String | Javascript

No, this post is not about dieting or anything like that… but to remove Special Kharacters. To do this, I was going to use a for loop in javascript that checks each character and if it is not between ‘A’ and ‘Z’, the character will be removed. Until I found this code lying around on the net which makes removing special characters very simple…

function removeSpecialChars(strVal)
{
strVal = strVal.replace(/[^a-zA-Z 0-9]+/g,”);
}

Shared Hosting | Unlimited Emails | Any Ideas?

Hmmm… I’m developing a website which will have a Newsletter Sender function to a list of emails… I’m seraching for a Shared Hosting which lets me send unlimited emails, or at least send about 2000 emails at one go. This will be used to send newsletters and email shots. Anyone has any idea if this type of hosting is available? And if yes which one?

Also someone told me to instead buy a VPS? Is it worth it for only one site?

HTC HD2 | Not Sending SMS

So a friend of mine just got a new HTC HD2… and let me tell you… the screen is amazing!! 4.3 inch full of color ;)… All worked well, phone calls, camera is great, sms received but he couldn’t send any sms. When trying to send, they remained in the outbox. We thought there was a problem with the sms service centre but there is no place where you can edit the service centre number.

After googling a bit, we found the Solution. You need to first… Continue reading

Sette Giugno | Today in Malta

Sette Giugno (from ItalianJune Seventh) is a Maltese national holiday celebrated annually on June 7. It commemorates events which occurred on that day in 1919, when following a series of riots by the Maltese population, British troops fired into the crowd killing four. (Wikipedia)

Today is also the day that the new iPhone is going to be shown to the world (hopefully)… plus a new multi touch track pad and also the new Safari 5… for the Maltese people, we’ll have to wait till tonight @ 7pm.