Search found 456 matches: decimal

Return to advanced search

Re: Decimal detection

... '122.' I should point out that technically 122.00000 is not the same as 122. "122.00000" implies that it is accurate to the nearest 5th decimal place (one hundred thousandth of a unit). And 122 implies it is accurate to the nearest whole number. I know that database number formats aren't ...
by James Bott
Sat Oct 09, 2021 6:53 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Re: Decimal detection

Code: Select all  Expand view
cNumToStr( nVal, [lEuropean], [lThouSep] )

2nd and 3rd parameters default to settings by FWNumFormat(...)
by nageswaragunupudi
Mon Sep 27, 2021 11:00 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Re: Decimal detection

Nages, cNum := cNumToStr( nValue, .f., .f. ) Wow, one line, I like that! Less is more. I note that in my version of FWH 1805, it is not listed in the documentation, but the function is in version 1805. You might want to check to make sure it is in the documentation for the latest version. Please tel...
by James Bott
Mon Sep 27, 2021 10:47 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Re: Decimal detection

Code: Select all  Expand view

cNum := Str( .... )
cTrim := If( "." $ cNum, RemRight( RemRight( cNum, "0" ), "." ), cNum )
 


OR
Simply use the FWH built-in function
Code: Select all  Expand view

cNum := cNumToStr( nValue, .f., .f. )
 

instead of using cNum := Str( nValue )
by nageswaragunupudi
Mon Sep 27, 2021 9:43 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Re: Decimal detection

...  do while right(cValue,1) = "0"      cValue:= left(cValue, len(cValue) -1)   enddo      // Remove trailing decimal point   if right(cValue,1) = "."      cValue:= left(cValue,len(cValue)-1)   endif   Return cValue
by James Bott
Mon Sep 27, 2021 8:30 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Re: Decimal detection

James, Francisco,

Thank you, they both are working fine.
The only thing was that if there was a value without decimal digits it returns the value with a dot.

Like '122.00000' returns '122.'

I will optimize it with testing if the return-value ends with '.', if so, I will return it without the '.'
by Marc Vanzegbroeck
Mon Sep 27, 2021 7:24 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Re: Decimal detection

function RemoveRightZeros(cString)  local nPos := 0, n, nLen := Len(cString)  if ValType(cString) <> "C"     MsgStop("El valor recibido debe ser del tipo Cadena de texto", "Alto")     Return ""  endif  FOR n := 1 TO nLen ...
by FranciscoA
Mon Sep 27, 2021 5:57 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Re: Decimal detection

Code: Select all  Expand view
Function RemoveZeros( cValue )
   do while right(cValue,1) = "0"
      cValue:= left(cValue, len(cValue) -1)
   enddo
Return cValue
by James Bott
Mon Sep 27, 2021 4:34 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Re: Decimal detection

Hi.
WhatsNew Fwh2106 contains this:
* Función FW_ExcelToDBF(): Elimina los ceros a la derecha después del decimal al
convertir números a texto.

Maybe it can help you.
Regards
by FranciscoA
Mon Sep 27, 2021 4:13 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Decimal detection

Hi, I want to convert some values from a database to a text file for export use. Normaly a use str() to convert the value. The problem is that if the field is define with 5 Decimals, and the value is 4.204, the export is 4.20400. Then I can use something like str(10,3). Is there a easy way to know t...
by Marc Vanzegbroeck
Mon Sep 27, 2021 1:22 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Decimal detection
Replies: 10
Views: 1501

Re: New FTDN June/Junio (FWH 21.06)

... ahora .T., con el nuevo registro cargado si la búsqueda tiene éxito. * Función FW_ExcelToDBF(): Elimina los ceros a la derecha después del decimal al convertir números a texto. * Nueva función FW_IndexInfo() --> { { ordbagname, ordname, ordkey, ordfor, ordkeyval } } TDatabase también ...
by Antonio Linares
Wed Jul 28, 2021 2:07 pm
 
Forum: WhatsNew / Novedades
Topic: New FTDN June/Junio (FWH 21.06)
Replies: 7
Views: 3610

New FTDN June/Junio (FWH 21.06)

... is nil, the method now returns .t., with the new record loaded if the seek is successful. * function FW_ExcelToDBF(): Trims right zeros after decimal when converting numbers to text. * New function FW_IndexInfo() --> { { ordbagname, ordname, ordkey, ordfor, ordkeyval } } TDatabase can also ...
by Antonio Linares
Tue Jul 27, 2021 4:47 pm
 
Forum: WhatsNew / Novedades
Topic: New FTDN June/Junio (FWH 21.06)
Replies: 7
Views: 3610

New FTDN June/Jnio (FWH 21.06)

... is nil, the method now returns .t., with the new record loaded if the seek is successful. * function FW_ExcelToDBF(): Trims right zeros after decimal when converting numbers to text. * New function FW_IndexInfo() --> { { ordbagname, ordname, ordkey, ordfor, ordkeyval } } TDatabase can also ...
by Antonio Linares
Tue Jul 27, 2021 4:46 pm
 
Forum: WhatsNew / Novedades
Topic: New FTDN June/Jnio (FWH 21.06)
Replies: 0
Views: 1092

Colors (SOLVED)

Hello friends!

I need a little help, I have a color in decimal (for example 6736896). How to get tones above or below, what's the logic?

Thanks
by ctoas
Sun Jun 13, 2021 11:27 pm
 
Forum: FiveWin for Harbour/xHarbour
Topic: Colors (SOLVED)
Replies: 10
Views: 1626

Re: cambiar picture "en caliente"

... de hecho me explique muy mal. Pido disculpas por eso. Lo que quiero y necesito es que el picture de un get NUMERICO ajuste sus digitos enteros y decimales a medida que el usuario va escribiendo. es decir, Comienzo con un get cuya variable contenedora es 0 y el picture es "@E 999,999,999,999.99" ...
by JoseAlvarez
Thu Jun 10, 2021 11:33 pm
 
Forum: FiveWin para Harbour/xHarbour
Topic: cambiar picture "en caliente"
Replies: 7
Views: 1264
PreviousNext

Return to advanced search