In this case, you can set the cost pricing components.
Create a separate pricing component for all durations.
For example: 1 week, 2 weeks, 3 weeks, etc.
In each component, limit it to the appropriate number of days.
This is done on the constraints tab:
Or you can specify a single formula from the number of booked days.
Let's make a formula for the months.
For example, the cost is $1000 a month.
Write the formula.
$1000 is multiplied by the number of booked days and divided by the number of days in a month.
Since months of different lengths, an error of several days is possible with long bookings.
1000 * Ceiling([INTERVALS]/31)
In this formula, we used the Ceiling function.
It rounds the result of division into a larger side.
For the general formula of weeks, you simply divide by 7, not by 31.
Look at this example in action: