Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
L'impostazione predefinita del formato numerico di Looker per i numeri visualizzati nelle tabelle di dati e nelle visualizzazioni รจ 1.234,56. Tuttavia, il formato numerico puรฒ essere impostato su uno dei seguenti valori:
1.234,56: migliaia separate da virgole; decimali separati da un punto
1.234,56: migliaia separate da punti; decimali separati da una virgola
1 234,56: migliaia separate da spazi; decimali separati da una virgola
Impostare i formati di numero per gli utenti
Puoi impostare un formato numerico utilizzando uno dei seguenti metodi:
Per impostare un formato numerico per singoli utenti: seleziona il formato desiderato dal menu a discesa Formato numerico nella pagina Modifica utente del riquadro Amministrazione e fai clic su Salva in fondo alla pagina.
Per impostare un formato numerico per un gruppo di utenti: assegna il formato desiderato all'attributo utente number_format per un determinato gruppo di utenti. Se gli utenti all'interno del gruppo hanno impostato un valore personalizzato per number_format, questo valore sostituirร qualsiasi valore assegnato al gruppo. Per evitare che il valore number_format assegnato venga sostituito, assicurati che l'impostazione Accesso utente per l'attributo utente number_formatnon sia impostata su Modifica.
Per impostare un formato numerico per un'intera istanza: assegna uno dei codici nella tabella precedente al campo Formato numerico nella pagina Localizzazione del riquadro Amministrazione.
Il formato numerico predefinito in Looker, 1.234,56, mostra i numeri in migliaia separati da virgole e i decimali separati da un punto.
Ad esempio, supponiamo di avere un'esplorazione con un grafico a colonne e una tabella di dati che mostra i valori di Conteggio ordini, Prezzo medio di vendita degli articoli dell'ordine e Prezzo totale di vendita degli articoli dell'ordine raggruppati per Mese di creazione degli ordini. I valori con l'impostazione predefinita avranno il formato x,xxx.xx.
Se modifichi l'impostazione Formato numerico in 1.234,56, i valori nelle visualizzazioni e nelle tabelle di dati assumeranno il formato x.xxx,xx:
L'impostazione Formato numerico con altri metodi di formattazione dei numeri
Se utilizzi i parametri LookML value_format_name o value_format per formattare i campi nei modelli, il formato numerico selezionato nell'impostazione Numero o nell'attributo utente number_format viene applicato al formato specificato nei parametri LookML. Ad esempio, supponiamo di avere una misura che rappresenti il conteggio delle torte con un value_format specificato definito in LookML:
Con l'impostazione Formato numerico impostata su 1.234,56 e il codice value_format: "####.0\"pies\"" di LookML, le visualizzazioni e le tabelle di dati mostrano i valori nel formato xxxx,xx piedi. L'impostazione Formato numerico sostituisce una virgola con il punto per value_format: "####.0\"pies\"". Un Conteggio di 9849 sarร visualizzato come 9849,0.
Analogamente, se utilizzi il campo Formato valore nel menu Modifica di una visualizzazione, il formato numerico impostato nell'impostazione Formato numeri o l'attributo utente number_format verrร applicato sopra il formato specificato nel campo Formato valore della visualizzazione.
Sostituzione dell'impostazione del formato numerico con strict_value_format
In genere, la formattazione numerica impostata nell'impostazione Formato numerico o nell'attributo utente number_format viene applicata sopra i formati applicati dai parametri LookML.
Tuttavia, se vuoi creare un formato numerico che non sia interessato dall'impostazione Formato numerico o dall'attributo utente number_format, puoi utilizzare il parametro del modello named_value_format per creare un formato numerico e impostare il relativo parametro secondario strict_number_format su yes. Puoi applicare questo formato ai campi utilizzando il parametro value_format_name e questi campi non saranno interessati dall'impostazione Formato numerico o dall'attributo utente number_format.
Ad esempio, supponiamo che in un file del modello sia definito un formato personalizzato denominato dollar_formatting. Il formato personalizzato ha un parametro secondario strict_value_format impostato su yes:
Il file della visualizzazione order_items nel progetto contiene due misure, average_sale_price e average_spend_per_user. Il formato personalizzato dollar_formatting viene applicato alla misura average_sale_price, ma non a average_spend_per_user:
measure: average_sale_price {
type: average
value_format_name: dollar_formatting
sql: ${sale_price} ;;
}
measure: average_spend_per_user {
type: average
sql: ${user_order_total_price} ;;
}
La formattazione dei numeri nell'impostazione Formato numerico รจ impostata su 1.234,56.
Nelle tabelle di dati e nelle visualizzazioni, i valori della misura Prezzo di vendita medio degli articoli dell'ordine verranno visualizzati nel formato x.xxx,xx$ e non saranno interessati dall'impostazione Formato numerico. Ad esempio, un prezzo scontato medio pari a 45,63 verrร visualizzato come 45,63$ nelle visualizzazioni e nelle tabelle di dati.
Nelle tabelle di dati e nelle visualizzazioni, i valori della misura Spesa media per utente per articoli dell'ordineverranno interessati dall'impostazione Formato numerico e verranno visualizzati nel formato $x.xxx,xx. Ad esempio, una spesa media per utente pari a 47,64 verrร visualizzata come 47,64$ nelle visualizzazioni e nelle tabelle di dati.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema รจ stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-31 UTC."],[],[],null,["# Localizing number formatting\n\n| **Note:** Number format localization is often set in conjunction with model localization and user-interface language selection. To learn more about those topics, visit the [Localizing your LookML model](/looker/docs/model-localization) and [Supported user-interface languages](/looker/docs/supported-user-interface-languages) documentation pages.\n\nLooker's default number format setting for numbers that appear in data tables and visualizations is **1,234.56**. However, the number format can be set to any of the following:\n\n- **1,234.56**: Thousands separated with commas; decimals separated with a period\n- **1.234,56**: Thousands separated with periods; decimals separated with a comma\n- **1 234,56**: Thousands separated with spaces; decimals separated with a comma\n\n### Setting number formats for users\n\nYou can set a number format through one of the following methods:\n\n- **To set a number format for individual users:** Select the desired format from the **Number format** drop-down menu on the [**Edit User** page](/looker/docs/admin-panel-users-users#editing_users) in the **Admin** panel and click **Save** at the bottom of the page.\n- **To set a number format for a user group:** Assign the desired format to the `number_format` user attribute for [a particular user group](/looker/docs/admin-panel-users-user-attributes#assigning_values_to_user_groups). If users within the group have set a custom value for `number_format`, the custom value will override any value that you assign to the group. To prevent the `number_format` that you assign from being overriden, ensure that the **User Access** setting for the `number_format` user attribute is *not* set to **Edit**.\n- **To set a number format for an entire instance:** Assign one of the codes in the previous table to the **Number format** field on the [**Localization** page](/looker/docs/admin-panel-general-localization) of the **Admin** panel.\n\nThe default number format in Looker --- **1,234.56** --- displays numbers in thousands separated with commas, and decimals separated with a period.\n\nFor example, suppose you have an Explore with a column chart and data table that displays values for **Orders Order Count** , **Order Items Average Sale Price** , and **Order Items Total Sales Price** grouped by **Orders Created Month** . Values with the default setting will take the format **x,xxx.xx**.\n\nIf you change the **Number format** setting to **1.234,56** , the values in visualizations and data tables will take the format **x.xxx,xx**:\n\n\n### The Number format setting with other methods of number formatting\n\nIf you use the LookML parameters [`value_format_name`](/looker/docs/reference/param-field-value-format-name) or [`value_format`](/looker/docs/reference/param-field-value-format) to format fields in your models, the number format selected in the **Number format** setting or `number_format` user attribute is applied on top of the format given in the LookML parameters. For example, suppose you have a measure that represents the count of pies with a specified `value_format` defined in LookML: \n\n measure: count {\n type: count\n value_format: \"####.0\\\"pies\\\"\"\n drill_fields: [detail*]\n }\n\nWith the **Number format** setting set to **1.234,56** , and the LookML `value_format: \"####.0\\\"pies\\\"\"`, visualizations and data tables display values in the format **xxxx,xx pies** . The **Number format** setting swaps a comma for the period for the `value_format: \"####.0\\\"pies\\\"\"`. A **Count** of 9,849 pies will display as 9849,0 pies.\n\nSimilarly, if you use the [**Value Format** field](/looker/docs/custom-formatting) in a visualization's **Edit** menu, the number format that is set in the **Number format** setting or the `number_format` user attribute will be applied on top of the format that is specified in the visualization **Value Format** field.\n\nFor example, if a user inputs the format `###0.000` in the **Value Format** field for a column chart, and the **Number format** is set to **1.234,56** , the visualization will display values in the format **xxxx,xxxx** . The **Number format** setting swaps a comma for the period for the visualization **Value Format** setting `###0.000`. A **Count** of 8,474 orders in the visualization will appear as **8474,000**.\n| **Note:** You cannot use LookML parameters or the **Value Format** field in a visualization's **Edit** menu to set formatting to 1.234,56 or 1 234,56. To set those formats, you must use the **Number format** setting or the `number_format` user attribute. `value_format`, `value_format_name`, and the **Value Format** field use [Excel-style formatting strings](/looker/docs/reference/param-field-value-format#common_formatting_strings).\n\n\n### Overriding the Number format setting with `strict_value_format`\n\nTypically, the number formatting set in the **Number format** setting or `number_format` user attribute is applied on top of formats applied by LookML parameters.\n\nHowever, if you want to create a number format that is not affected by the **Number format** setting or the `number_format` user attribute, you can use the [`named_value_format`](/looker/docs/reference/param-model-named-value-format) model parameter to create a number format and set its `strict_number_format` subparameter to `yes`. You can apply that format to fields by using the [`value_format_name`](/looker/docs/reference/param-field-value-format-name) parameter, and those fields will not be affected by the **Number format** setting or the `number_format` user attribute.\n\nFor example, suppose that a custom format called `dollar_formatting` is defined in a model file. The custom format has a `strict_value_format` subparameter that is set to `yes`: \n\n named_value_format: dollar_formatting {\n value_format: \"$#,###.00\"\n strict_value_format: yes\n }\n\nThe `order_items` view file in the project has two measures, `average_sale_price` and `average_spend_per_user`. The `dollar_formatting` custom format is applied to the `average_sale_price` measure, but not to the `average_spend_per_user`: \n\n measure: average_sale_price {\n type: average\n value_format_name: dollar_formatting\n sql: ${sale_price} ;;\n }\n\n measure: average_spend_per_user {\n type: average\n sql: ${user_order_total_price} ;;\n }\n\nThe number formatting in the **Number format** setting is set to **1.234,56**.\n\nIn data tables and visualizations, the values for the **Order Items Average Sale Price** measure will appear in the format **$x,xxx.xx** and will *not* be affected by the **Number format** setting. For example, an **Average Sale Price** of 45.63 will appear as **$45.63** in visualizations and data tables.\n\nIn data tables and visualizations, the values for the **Order Items Average Spend per User** measure *will* be affected by the **Number format** setting and will appear in the format **$x.xxx,xx** . For example, an **Average Spend per User** of 47.64 will appear as **$47,64** in visualizations and data tables."]]