Code archives/Algorithms/NUMBER FORMAT FOR INTEGERS

This code has been declared by its author to be Public Domain code.

Download source code

NUMBER FORMAT FOR INTEGERS by virtualjesus2010
Convierte una cadena entera numerica a formato numeros con separador de miles
Function Format$(Number$,Sep$=".")
	Local I%,Cadena$="",Cadena2$="",C%,Long%=Len(Number)
	For I=1 To Long
		C=C+1
		If C>3 Then C=1:Cadena=Cadena+Sep
		Cadena=Cadena+Mid$(Number,Len(Number)-I+1,1)
	Next
	Long=Len(Cadena)
	For I=1 To Long
		Cadena2=Cadena2+Mid$(Cadena,Long-I+1,1)
	Next
	Return Cadena2
End Function

Print "["+Format("1365454",".")+"]"
WaitMouse()

Comments

Ked2010
I like how the title is in English, but the description is not...


Jesse2010
Mira! Tambien funciona con valores numericos:
Print "["+Format(1365454,".")+"]"



markcw2010
Translation: Converts a numeric string formatted to whole numbers with separator to the thousands.

Also: Cadena = String


virtualjesus2010
Hice el proceso con cadenas, porque en enteros muy grandes parece haber error. pero es facil cualquier numero se puede para a string con Str(numero)


Ked2010
Are you kidding me? Welcome to BlitzBasic.com, an English community forum.


Jesse2010
@Ked
Oh si, que bueno! ;)


markcw2010
@virtualjesus, por favor, se puede utilizar traducción de Google aquí para aquellos de nosotros que no hablan español. Gracias.


Dabhand2010
vola vou she say as et viow!

:)

Dabz


Jesse2010
I don't know french but Google is my friend ;)


Dabhand2010

I don't know french but Google is my friend ;)



Neither do I, and I have no clue what I've just said up there either... I thought it was appropriate thought! ;)

Dabz


Shambler2010
@Ked Bah!, only an English forum?

Perhaps we should have a few areas for other languages then we can all learn something. Mark? Simon?...

Don't you mean 'English speaking' rather than 'English'?

Of course you do. xie xie


Ked2010
Yes, I meant English is the "national language" on these forums.


Jesse2010
but sense there is no Spanish Blitz forum I'll sneak a phrase here and there. he he. No harm intended.

I wish people were a lot nicer(lenient) here. There are people that only know a couple of words in English yet they are trying hard to learn a computer language with the available limited resources.
I agree with Shambler about adding other language sections yet I can see the problem moderating it.


Panno2010
.


ShadowTurtle2010
Perhaps we should have a few areas for other languages then we can all learn something.

I do support the german _language_. So i would like a german forum area :)


Code Archives Forum