C# Formatting Long variable as String -


i'm trying take variable (long), , convert string, such that:

150 -> 150 1500 -> 1,500 1234567 -> 1,234,567 

i know shouldn't difficult, far, i've been able find 2 different solutions, , they're not giving me output want:

this: string.format("{0:n}", *long variable*.tostring())

gives me: 2000 -> 2000

and this: *long variable*.tostring("n" or "n0")

gives me: 2000 -> 2000.00

someone commented correct syntax on answer deleted, sake of reading in future, here works:

string.format("{0:#,##0}", *long variable*)


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -