
618 A.2d 1325 (1992)
In re D.C.
No. 91-564.
Supreme Court of Vermont.
November 6, 1992.
*1326 Valerie White and Ruth Oberg, Law Clerk, On the Brief, Hyde Park, for petitioner-appellant.
Jeffrey L. Amestoy, Atty. Gen., Montpelier and Janet Bull, Asst. Atty. Gen., Waterbury, for respondent-appellee.
Dixie Henry, Vermont Development Disabilities Law Project, Burlington, for amicus curiae Vermont Protection and Advocacy, Inc.
Before ALLEN, C.J., and GIBSON, DOOLEY, MORSE and JOHNSON, JJ.
MORSE, Justice.
D.C., a 27-year-old mentally retarded man sentenced for attempted sexual assault, appeals from the dismissal of a petition to place him in the custody of the commissioner of Mental Health and Mental Retardation. The family court dismissed the petition because the commissioner could not reasonably afford to treat D.C. at the relatively high predicted cost. In defending the dismissal, the commissioner claims that the court should have dismissed the petition on other grounds as well. In his cross-appeal, the commissioner argues that the court lacked subject matter jurisdiction over the proceeding because civil commitment was not available for someone, like D.C., who had been found competent to stand trial on criminal charges. Further, he asserts that the court erred by not approving the state's attorney's request to dismiss under the authority of 18 V.S.A. § 8823(a). We affirm.
In October 1990, D.C. was charged in district court with several crimes, including attempted sexual assault. He was found competent to stand trial for the offenses and subsequently negotiated a conditional plea agreement with the State under which he was to be incarcerated for one year. The incarceration was to be followed by a period of probation which included residential placement, twenty-four-hour supervision, and intensive sex offender therapy.
At the time of the plea negotiations, a presentence investigation was performed by a probation officer, who recommended a longer period of incarceration because the level of probationary supervision and programming necessary for D.C. was unavailable in the Department of Corrections. Accordingly, defense counsel filed a petition as an "interested [person]" under 18 V.S.A. §§ 8821(3) and 8822(b), seeking the commitment of D.C. to the custody of the commissioner of Mental Health and Mental Retardation under Act 248, 18 V.S.A. §§ 8839-8846. Act 248 embodies a civil means of committing mentally retarded individuals who are at risk. Treatment is provided in community-based programs.
Because no such program had been secured for D.C. prior to the sentencing hearing, the district court rejected the plea agreement. Consequently, following an adjudication of guilt the district court sentenced D.C. to serve 4-10 years. Nonetheless, pursuant to Act 248, defense counsel continued to pursue the civil commitment of D.C. to the commissioner of Mental Health and Mental Retardation.
The commissioner and the state's attorney, who is responsible under 18 V.S.A. § 8823(a) to prosecute the action under Act 248, moved to dismiss the petition. The court denied the motions. At the merits hearing, the parties stipulated that D.C. was mentally retarded and presented a danger of harm to others, thereby satisfying two of the three criteria for commitment under § 8843(c).[*] As to the third *1327 element, however, the court concluded that the Department of Mental Health and Mental Retardation lacked the funds necessary, estimated at $100,000 a year, to implement the program recommended by the experts who had evaluated D.C. Notably, the court found that funding of a program for D.C.'s community placement would require reallocation of funds already assigned to an estimated 1554 disabled individuals currently served by the commissioner. Accordingly, the court dismissed the petition.

I.
The family court did not err when it denied the state's attorney's request to dismiss the petition under the authority of 18 V.S.A. § 8823(c), which states that "[t]he attorney for the state may, with the approval of the court, dismiss the petition at any state of the proceedings." (Emphasis added.) Despite the legislature's directive that any dismissal be approved by the court before it can take effect, the State, relying on the "considerable discretion" afforded state's attorneys in their prosecutorial role, State v. Reed, 127 Vt. 532, 539, 253 A.2d 227, 232 (1969), insists the court erred in not approving the State's request. The State contends that, in effect, the court forced the state's attorney to undermine his objectives in the criminal case against D.C. by requiring him to pursue the civil commitment.
We reject this argument for the simple reason that the state's attorney's objectives must comport with the directives of the legislature. The legislature placed the final authority for dismissal with the court, and unless it amends § 8823(c) to remove that authority, the state's attorney cannot complain that he has been deprived of vested discretionary authority. Alternatively, if the basis of the State's argument is that the court abused its discretion because the claim was meritless, that lack of merit did not become apparent until the hearing on the merits. In the end, the State achieved a dismissal on the merits. Unless we turn the concept of due process around and have the decision precede the hearing, the State was not entitled to more.

II.
The trial court had subject matter jurisdiction to hear and rule on the commitment proceedings. The commissioner argues that because D.C. had already been found competent to face the criminal charges, the court lacked authority under Act 248 to grant the requested relief.
A person may be committed to the commissioner's custody if in need of "custody, care and habilitation." 18 V.S.A. § 8843(c). Such a person is defined as "a mentally retarded person," "who presents a danger of harm to others," "for whom appropriate custody, care and habilitation can be provided by the commissioner in a designated program." 18 V.S.A. § 8839(3). Admittedly, one who "presents a danger of harm to others" may be particularly prone to commit a crime of violence and be prosecuted for it. Yet, Act 248 does not in any manner base its criteria for civil commitment upon the person's involvement in criminal proceedings. The only qualification is found in 18 V.S.A. § 8844, which states that "[n]o determination that a person is in need of custody, care and habilitation and no order authorizing commitment shall lead to a presumption of legal incompetence." Section 8844, however, only restricts the evidentiary use of a civil commitment in other civil proceedings and criminal matters involving that person.
A person who is committed to the supervision of the commissioner of corrections may be transferred to the Department of Mental Health and Mental Retardation so long as the civil commitment process under Title 18 is followed. 28 V.S.A. § 703(a). If that is so, we fail to see why the civil commitment process may not be pursued during the criminal process. Substantively, the test for competency to stand trial in a criminal case is different from the test for civil commitment. A person who is capable of understanding the nature of the charges and participating in the defense, State v. Williams, 154 Vt. 76, 79, 574 A.2d 1264, 1265 (1990), may or may not be mentally retarded and a danger to others, and vice versa.
*1328 Nothing in the language of the applicable legislation indicates that criminal charges and civil commitment are mutually exclusive. Further, commitment proceedings are mandated in two circumstances relevant to this case. A defendant either found incompetent to stand trial or acquitted of criminal charges by reason of insanity must undergo a commitment proceeding. 13 V.S.A. § 4820. No legislative intent can be found that persons ruled competent to stand trial in a criminal case are disqualified per se from commitment under Act 248.

III.
The family court, however, did not err when it dismissed the petition based on the commissioner's shortage of funding. At issue in this case is the interpretation of the third prong of § 8839, defining a "person in need of custody, care and habilitation," which states, "for whom appropriate custody, care and habilitation can be provided by the commissioner in a designated program." 18 V.S.A. § 8839(3)(C) (emphasis added). Specifically, we must decide whether the words "can be provided" in § 8839(3)(C) encompass fiscal considerations.
D.C. maintains that § 8839(3)(C) mandates commitment to the commissioner if treatment is theoretically possible, even when practically impossible or, at best, wholly unreasonable. D.C. does not challenge the family court's agreement with the commissioner's assessment that spending $100,000 a year on D.C. was an unreasonable allocation of resources, and we reject an "anything is possible" interpretation of the "can be provided" criterion.
Among the powers, duties, and functions conferred by statute, the commissioner may "coordinate services as to most efficiently carry out the purposes of" mental health legislation and "plan and coordinate the development of community services" for mentally retarded individuals in the state. 18 V.S.A. § 7401(1), (14). Given the broad discretion afforded the commissioner in delivering services, this Court has already determined that fiscal considerations are germane to the commissioner's obligations under similar circumstances. In In re C.B., we held that placement of mentally retarded individuals in the least restrictive environment consistent with adequate treatment does not mandate placement if funds are unavailable. 147 Vt. 378, 383, 518 A.2d 366, 370 (1986). There we noted:
While it is undoubtedly true that every budgetary concern could be reduced to a question of allocation, we do not believe that the Legislature intended the courts to be overseeing how the Department of Mental Health prioritizes needs, and allocates monies appropriated for the care of the mentally retarded.
Id.
D.C. contends, however, that had the legislature wanted to condition commitment under § 8843 on availability of funding, it would have provided specific language to that effect in the statute, as it did in the Community Mental Health Services statute, 18 V.S.A. § 8907. Section 8907(a) restricts services "within the limits of funds designated by the legislature for this purpose," and § 8907(b) restricts services "[w]ithin the limits of available resources." Because § 8839(3)(C) lacks this limiting language, D.C. argues that fiscal considerations are not a relevant criterion.
Section 8907 is a legislative directive to the commissioner to consider the department's budget when spending money on community mental health programs. The commissioner implements these community mental health programs, within appropriate budgetary restraints, and there is no court involvement. In contrast, the court decides in a civil commitment proceeding who is eligible for the appropriate programs. The legislature's directive to the court, when it decides whether to commit someone, is similar to the commissioner's responsibility in administering community health programs, albeit in different words. Under § 8839, the court must assess whether the commissioner can reasonably meet the needs of the petitioner. Meeting needs ordinarily involves spending money.
18 V.S.A. § 8835 is more to the point. It directs the commissioner to *1329 ensure that, within the limits of funds made available for care for mentally retarded persons, the following are maintained for each mentally retarded person placed in his custody pursuant to this chapter ... and for each mentally retarded person placed in a residential facility established by the commissioner:
(1) a current individual program plan; and
(2) appropriate and specific support personnel and services, all or most of which are reasonably available, to implement such plan....
Read in conjunction with § 8835, § 8839(3)(C) reasonably leads to the conclusion that the standard, "appropriate custody, care and habilitation can be provided," includes services that are affordable.
The responsibility for fiscal management is where it should be. The commissioner, subject to court supervision, is in a better position to assess the hard choices that arise when a limited amount of funds must serve hundreds of persons in need of programs.
Affirmed.
NOTES
[*]  18 V.S.A. § 8843(c) states:

If the court finds that the respondent is a person in need of custody, care and habilitation, it shall order the respondent committed to the custody of the commissioner for placement in a designated program in the least restrictive environment consistent with the respondent's need for custody, care and habilitation for an indefinite or a limited period.
Section 8839(3) defines "person in need of custody, care and habilitation" as follows:
(A) a mentally retarded person;
(B) who presents a danger of harm to others; and
(C) for whom appropriate custody, care and habilitation can be provided by the commissioner in a designated program.
