Home
Products
Community
Manuals
Contact
Login or Signup

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 virtualjesus(Posted 1+ years ago)
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

Ked(Posted 1+ years ago)
I like how the title is in English, but the description is not...


Jesse(Posted 1+ years ago)
Mira! Tambien funciona con valores numericos:
Print "["+Format(1365454,".")+"]"



markcw(Posted 1+ years ago)
Translation: Converts a numeric string formatted to whole numbers with separator to the thousands.

Also: Cadena = String


virtualjesus(Posted 1+ years ago)
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)


Ked(Posted 1+ years ago)
Are you kidding me? Welcome to BlitzBasic.com, an English community forum.


Jesse(Posted 1+ years ago)
@Ked
Oh si, que bueno! ;)


markcw(Posted 1+ years ago)
@virtualjesus, por favor, se puede utilizar traducción de Google aquí para aquellos de nosotros que no hablan español. Gracias.


Dabhand(Posted 1+ years ago)
vola vou she say as et viow!

:)

Dabz


Jesse(Posted 1+ years ago)
I don't know french but Google is my friend ;)


Dabhand(Posted 1+ years ago)

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


Shambler(Posted 1+ years ago)
@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


Ked(Posted 1+ years ago)
Yes, I meant English is the "national language" on these forums.


Jesse(Posted 1+ years ago)
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.


Panno(Posted 1+ years ago)
.


ShadowTurtle(Posted 1+ years ago)
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