Join the newly launched Discord
community for real-time discussions, peer support, and direct interaction with the Meridian team!
meridian.analysis.optimizer.get_round_factor
Stay organized with collections
Save and categorize content based on your preferences.
Gets the number of integer digits to round off of budget.
meridian
.
analysis
.
optimizer
.
get_round_factor
(
budget
:
float
,
gtol
:
float
)
->
int
Float number for total advertising budget.
Float indicating the acceptable relative error for the budget used in
the grid setup. The budget will be rounded by 10*n
, where n
is the
smallest int such that (budget - rounded_budget) <= (budget * gtol)
. gtol
must be less than 1.
Integer number of digits to round budget to.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-05 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-05 UTC."],[],[],null,["\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/google/meridian/blob/v1.2.0/meridian/analysis/optimizer.py#L2724-L2745) |\n\nGets the number of integer digits to round off of budget. \n\n meridian.analysis.optimizer.get_round_factor(\n budget: float, gtol: float\n ) -\u003e int\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `budget` | Float number for total advertising budget. |\n| `gtol` | Float indicating the acceptable relative error for the budget used in the grid setup. The budget will be rounded by `10*n`, where `n` is the smallest int such that `(budget - rounded_budget) \u003c= (budget * gtol)`. `gtol` must be less than 1. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| Integer number of digits to round budget to. ||\n\n\u003cbr /\u003e"]]