• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setting number formats in cells with AS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting number formats in cells with AS


  • Subject: Re: setting number formats in cells with AS
  • From: Stan Cleveland <email@hidden>
  • Date: Mon, 13 May 2013 12:34:47 -0700

On May 13, 2013, at 9:05 AM, Robert Cuilla wrote:

> I am struggling a bit trying to set the format of number cells to be in
> the format of 123.40 when the value is 123.40   I don't want 123.4
>
> Can anyone help or point me in the correct direction?

Hi Bob,

To control the format of a specific cell or range, try these:
	set number format of cell "A1" to "0.00"
	set number format of range "A1:C7" to "$#,##0.00;([Red]$#,##0.00)"

The format string "0.00" specifies a leading zero (if the number is less than one) and two decimal digits.

The format string "$#,##0.00;($#,##0.00)" specifies a leading dollar sign, comma as the thousands separator (if needed), leading zero (if less than one dollar), two decimal digits, with negative numbers both red in color and parenthesized.

The rules for defining format strings are not simple, but are relatively easy to understand. You can see examples by looking at the "Custom" category under the "Number" tab in the "Format Cells" palette that is called up by selecting the "Cells…" menu item from the "Format" menu. That's also the place to fiddle around with format strings to see how they work.

HTH,
Stan C.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


  • Follow-Ups:
    • Re: setting number formats in cells with AS
      • From: Shane Stanley <email@hidden>
References: 
 >setting number formats in cells with AS (From: Robert Cuilla <email@hidden>)

  • Prev by Date: Re: setting number formats in cells with AS
  • Next by Date: Re: setting number formats in cells with AS
  • Previous by thread: Re: setting number formats in cells with AS
  • Next by thread: Re: setting number formats in cells with AS
  • Index(es):
    • Date
    • Thread