Hi,
Harbour/Clipper:
? 235.1234/100
2.35 not 2.351234
Any express return 2 decimals .
Mysql : select 235.1234/100
2.35123400
Regards!
Shuming Wang
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Hi,
Harbour/Clipper:
? 235.1234/100
2.35 not 2.351234
Any express return 2 decimals .
Mysql : select 235.1234/100
2.35123400
Regards!
Shuming Wang
ShumingWang
Try the SET DECIMALS command .. see below for syntax ..
Rick Lipkin
SET DECIMALS
Defines the number of decimal places for displaying numeric values on the screen.
Syntax
SET DECIMALS TO [<nDecimals>]
Arguments
<nDecimals>
This is a numeric value specifying the number of decimal places for screen output of numbers. The default value is 2. If <nDecimals> is omitted, the number of decimal places is set to zero. Description
SET DECIMALS defines the number of decimal places for the display of numbers in text-mode applications. Note that the command affects only the display and not the accuracy of calculations with numeric values. If a number has more decimal places than <nDecimal>, the number is rounded for display.
Note: to activate a fixed number of decimal places for screen display, SET FIXED must be set to ON.
#Include "FiveWin.ch"
FUNCTION Main()
LOCAL nRetDec := 0
SET FIXED ON
? 25141251 / 362
SET DECIMALS TO 10
? 214514.214 / 6325
SET DECIMALS TO 4
? 235.1234 / 100
SET DECIMALS TO 2
? 235.1234 / 100
SET DECIMALS TO 2
nRetDec := 235.1234
? ROUND( nRetDec, 2 ) / 100
RETURN NILThanks !
Shuming Wang