NEW YORK – Like any fitness program, it works only if you pay attention to it.

A new study on New York City’s effort to encourage healthy eating by posting calorie counts on menus shows that it worked for about one in six customers – or those who paid heed to them. Those who ignored the numbers or didn’t see them ordered whatever they wanted, regardless of how fattening it was.

City health officials who conducted the study said that’s good news. On any given visit, customers who looked at the counts generally ordered about 100 fewer calories than those who didn’t, according to the results of the study published Tuesday in the British medical journal BMJ.

In 2008, New York became the first municipality in the U.S. to require chain restaurants to post the counts, and other places including California and Seattle followed suit. Starting next year, a federal law will require all chains with 20 or more locations to print calorie counts on menus.

The study was the first large-scale look at the initiative’s success at several different chains. Lynn D. Silver, assistant commissioner of the city Department of Health and Mental Hygiene and one of the study’s authors, said it showed modest gains in getting people to order lower-calorie meals. But she said the law also led restaurants to widen their offerings of healthier food, such as salads.

About a third of adults in the U.S. are obese, according to the federal Centers for Disease Control and Prevention.

The study looked at lunchtime purchases at 11 fast-food chains around New York in 2007, before the city law was passed, and then again in 2009. Researchers asked customers for their receipts and spoke to them . There was no significant change overall. But customers did order fewer calories, on average, at three major chains: McDonald’s, Au Bon Pain and KFC. The study says those restaurants also introduced healthier choices around the same time the law was passed.