# Number Question?

## Recommended Posts

Definetly new to programming and working my first one, but learning.

My question is:

How do i get the below to give me a return of .00 at the end of the total balance if all 6 of the \$'s are .00's

0000.00 + 000.00, so on. right now i get 0000 as a return instead of 0000.00

this works right 000.01 + 0000.00 = 0000.01

\$Total = Number (\$wellsfargo+\$usbank+\$chase+\$merrick+\$royal+\$fedreserve)

##### Share on other sites

```\$Total = Number (\$wellsfargo+\$usbank+\$chase+\$merrick+\$royal+\$fedreserve)
\$FormattedTotal = StringFormat("%.2f",\$Total )```

Edited by JdeB

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

This is not the best way but you could do

```Global \$nums[2]
\$nums[0] = 0.00
\$nums[1] = 0.00
Local \$ret
For \$i = 0 To UBound(\$nums, 1) - 1
\$ret = \$ret + \$nums[\$i]
Next
If Not StringInStr(String(\$ret), ".") Then
\$ret = \$ret & ".00"
EndIf
Return \$ret

Call _Add with an array of numbers.

--too slow... and JdeB's is a lot better >.<

~cdkid

Edited by cdkid

AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...