Qbasicnews.com

Full Version: Function: Separate the integer part of the fractional part without rounding.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
FUNCTION enterdec$ (v$, x$)
'Function: Separate the integer part of the fractional part without rounding.
'The X$ must be: E = integer <> D = decimal

'Funcion: Separa la parte entera de la parte decimal sin redondeos
'La x$ tiene que ser: E = entero <>  D = decimal

x$ = UCASE$(x$)
FOR n = 1 TO LEN(v$)
z$ = MID$(v$, n, 1)
IF z$ = "." THEN w = 1
IF w = 0 THEN ent$ = ent$ + z$: lent = lent + 1
IF w = 1 THEN dec$ = dec$ + z$: ldec = ldec + 1
NEXT n
IF x$ = "E" THEN enterdec$ = ent$
IF x$ = "D" THEN enterdec$ = dec$
END FUNCTION
You can use the INT function
or
A=B\C
Hi, Opresion:

Very Thanks!

Greeting from Spain
(08-19-2008, 12:36 PM)lrcvs link Wrote:Hi, Opresion:
Very Thanks!
Greeting from Spain

Greetings from Mexico.
Es bueno saber que hay mas hispanos / latinos que nos gusta Qbasic.

Ya empezaba a preocuparme, si era el unico hispano / latino que le gustase Qbasic.!

En este foro y en Bsic he encontrado muy buenos amigos.

Saludos desde España

.................................................

It's good to know that there are more Hispanis / Latins we like QBasic.

It was beginning to worry about, whether it was the only Hispanis / Latin who likes QBasic.!

In this forum, and BAsic I found very good friends.

Greetings from Spain






Hello Opresion:

I know that page.

Also I saw your name on several consultations and the pages indicating that know them well.

However, I do not understand really want to say in that post on separate the integer part of the decimal.

Greetins from Spain
(08-20-2008, 02:20 PM)lrcvs link Wrote:...I do not understand really want to say in that post on separate the integer part of the decimal.

There is no relation, it's just info.
Ok.

Vale!