Avatar of developingprogrammer
developingprogrammer

asked on 

formatting number for thousands' comma #,###,###,###

hey guys!

i'm curious. if i have 2 numbers

9999
9999999999

and i want to insert commas in the thousands position to make it more readable so it'll look like this

9,999
9,999,999,999

i know i can do Format(strEndingBalance, "#,###,###,###.00")

and apply it to both numbers.

however what if i have another number

9999999999999999999999999999999999999999999999999999999999

(ok just ignore that no variable can store that hahaha - i think!! hrmm, can any variable store that number? i feel like Ali G asking the scientists about computers if they can multiply 999999999999991099910101010999 x 9999101099998910101010!! hahaha http://www.youtube.com/watch?v=eB5VXJXxnNU)

is there a format that i can use that will apply the comma at even interval recursively or must i type out a very very very long format string like the following?



Format(strEndingBalance, "#,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###,###.00")?

haha k that's REALLY LONG!!

is there anyway i can type out Format(strEndingBalance, "#,###") and make it recursive? thanks guys!! = ))
Microsoft Access

Avatar of undefined
Last Comment
developingprogrammer
SOLUTION
Avatar of Bill Ross
Bill Ross
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of developingprogrammer
developingprogrammer

ASKER

whao guys, fantastic!! i didn't know about "Standard", i didn't know that #,### would repeat and definitely didn't know about the esoteric function FormatNumber!! haha great!! = )

in the end i decided to use

Format(CCur(varEndingBalance), """Credit:"" #,###.00;""Debit:"" #,###.00")

because that gave more control over the prefixes.

but thanks guys for all your help, appreciate it!! = ))
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo