formating number

J

Jeff

hey guys

If i wish to show a decimal on a number, i can do this

v2_score = formatnumber(v2_score1, 0)

but how would i only show the 2 decimal places IF there is an actual
remainder after the division?

here is the script and stuff
using sql db server

v2_score1 = v_score / v_played
v2_score = formatnumber(v2_score1, 0)

v_score is an over all total in the db
v_played is how many matches were played.

any help please.... and thank you??
 
M

MadMike42

Use the MOD function,
this will return the numbers after the point

example
a) 42/100 = 0.42
b) 42 mod 100 = 42

SO if you have a result to the MOD sum, you can show
with the formatting, if no result, you can show with out the formatting

Mike.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top