Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Untuk developer Looker: Pemformatan yang ditampilkan di halaman ini sama dengan pemformatan yang digunakan dengan parameter LookML value_format, kecuali parameter value_format memerlukan string pemformatan yang diapit tanda petik ganda.
Pemformatan kustom memberi Anda kontrol yang lebih besar atas tampilan data numerik dalam set hasil Looker. Dengan pemformatan kustom, Anda dapat menerapkan opsi pemformatan bergaya Excel ke data numerik yang ditampilkan dalam visualisasi, atau dihasilkan oleh kolom kustom atau kalkulasi tabel.
Menggunakan pemformatan kustom dalam visualisasi
Untuk visualisasi dengan tab Nilai di menu roda gigi:
Pilih menu Edit di kolom Visualisasi.
Pilih tab Nilai.
Di kolom Format Nilai, masukkan string pemformatan kustom.
Misalnya, untuk menambahkan pemformatan kustom untuk visualisasi tabel:
Pilih menu Edit di kolom Visualisasi.
Pilih tab Seri.
Di bagian Penyesuaian, pilih drop-down Format, lalu pilih Kustom....
Kolom kosong baru akan muncul saat Anda memilih Kustom.... Masukkan string pemformatan kustom di kolom kosong.
Menggunakan pemformatan kustom dengan kalkulasi tabel dan kolom kustom
Saat Anda membuat atau mengedit kalkulasi tabel atau kolom kustom, pilih opsi Kustom di drop-down Format dan masukkan format kustom di kolom kosong.
Beberapa opsi pemformatan yang paling umum tercantum dalam tabel berikut. Kode format yang menggunakan 0 mengharuskan nol yang tidak signifikan ditampilkan jika angka berisi lebih sedikit digit daripada yang ditentukan dalam kode. Kode format yang menggunakan # hanya menampilkan digit signifikan, meskipun jumlah digitnya lebih sedikit daripada yang ditentukan dalam kode.
Beberapa karakter khusus, seperti simbol mata uang internasional, harus diperlakukan sebagai string dan diapit dalam tanda kutip ganda.
Format
Hasil
0
Bilangan bulat (123)
00#
Bilangan bulat yang diisi dengan nol hingga 3 tempat (001)
0 "String"
Bilangan bulat diikuti dengan string (123 String)("String" dapat diganti dengan string teks apa pun)
0.##
Angka hingga 2 desimal (1. atau 1.2 atau 1.23)
0.00
Angka dengan tepat 2 desimal (1.23)
00#.00
Angka yang diisi dengan nol hingga 3 tempat dan tepat 2 desimal (001.23)
#,##0
Angka dengan koma di antara ribuan (1.234)
#,##0.00
Angka dengan koma di antara ribuan dan 2 desimal (1.234,00)
0.000,, "M"
Angka dalam jutaan dengan 3 desimal (1.234 M)Pembagian dengan 1 juta akan terjadi secara otomatis
0.000, "K"
Angka dalam ribuan dengan 3 desimal (1.234 K)Pembagian dengan 1.000 terjadi secara otomatis
$0
Dolar dengan 0 desimal ($123)
$0.00
Dolar dengan 2 desimal ($123,00)
"€"0
Euro dengan 0 angka di belakang koma (€123)
$#,##0.00
Dolar dengan koma di antara ribuan dan 2 angka di belakang koma ($1.234,00)
$#.00;($#.00)
Dolar dengan 2 desimal, nilai positif ditampilkan secara normal, nilai negatif diapit tanda kurung
0\%
Tampilkan sebagai persentase dengan 0 desimal (1 menjadi 1%)
0.00\%
Tampilkan sebagai persentase dengan 2 desimal (1 menjadi 1,00%)
0%
Mengonversi ke persentase dengan 0 desimal (.01 menjadi 1%)
0.00%
Mengonversi ke persen dengan 2 desimal (.01 menjadi 1,00%)
Pemformatan waktu untuk diagram
Jika diagram Anda memiliki dimensi waktu pada sumbu x, Anda dapat mengubah format label sumbu x menggunakan setelan Format Label Waktu di tab X pada opsi visualisasi. Anda dapat memformat nilai waktu dengan menggunakan sintaksis di halaman Pemformatan waktu untuk diagram.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-25 UTC."],[],[],null,["# Adding custom formatting to fields\n\n| **Note:** This page is part of the [Retrieve and chart data](/looker/docs/retrieve-and-chart-data) learning series.\n\u003e For Looker developers: The formatting shown on this page is the same as formatting used with the [`value_format` LookML parameter](/looker/docs/reference/param-field-value-format), except that the `value_format` parameter requires the formatting string to be enclosed in double quotes.\n\nCustom formatting gives you greater control over how numeric data appears in a Looker result set. With custom formatting, you can apply Excel-style formatting options to numeric data shown in [visualizations](/looker/docs/creating-visualizations), or produced by [custom fields](/looker/docs/custom-fields) or [table calculations](/looker/docs/table-calculations).\n| **Caution:** Custom formatting is supported only for [dimensions of `type: number`](/looker/docs/reference/param-dimension-filter-parameter-types#number) or [measures of `type: number`](/looker/docs/reference/param-measure-types#number). Users who do not have `develop` permissions can view a field's data type by selecting the [**Info** icon](/looker/docs/creating-and-editing-explores#info_icon) next to a field's name in the Explore [field picker](/looker/docs/creating-and-editing-explores#field-specific_information_and_actions).\n\nUsing custom formatting in visualizations\n-----------------------------------------\n\nFor visualizations with a **Values** tab in the gear menu:\n\n1. Select the **Edit** menu on the **Visualization** bar.\n2. Select the **Values** tab.\n3. In the **Value Format** field, enter the custom formatting string.\n\nFor example, to add custom formatting for a [table visualization](/looker/docs/table-options):\n\n1. Select the **Edit** menu on the **Visualization** bar.\n2. Select the **Series** tab.\n3. In the **Customizations** section, select the **Format** drop-down and choose **Custom...**.\n\nA new blank field will appear when you select **Custom...**. Enter the custom formatting string in the blank field.\n\nUsing custom formatting with table calculations and custom fields\n-----------------------------------------------------------------\n\nWhen you create or edit a [table calculation](/looker/docs/table-calculations#creating_table_calculations) or [custom field](/looker/docs/custom-fields), select the **Custom** option in the **Format** drop-down and enter the custom format in the blank field.\n\nCustom formatting examples\n--------------------------\n\nYou can reference Excel's complete guide to specifying these formats [on their Number format codes documentation page](https://support.office.com/en-us/article/number-format-codes-5026bbd6-04bc-48cd-bf33-80f18b4eae68), or you can use a third-party tool to build a custom format, such as [Custom Formats Builder](https://customformats.com/).\n| **Warning:** Date formatting, color formatting, and hexadecimal conversion are not supported in Looker.\n\nSome of the most common formatting options are listed in the following table. A format code that uses `0` requires that non-significant zeros be displayed if the number contains fewer digits than specified in the code. A format code that uses `#` displays only the significant digits, even if there are fewer digits than specified in the code.\n\nSome special characters, such as international currency symbols, must be treated as strings and enclosed in double quotes.\n| **Caution:** Excel-style formatting does not support many international number formats, such as 1.234,56 or 1 234,56. Looker does support several international formats through the localization function. For information about localizing number formats, see the [Localizing number formatting](/looker/docs/localizing-number-formatting) documentation page.\n\nTime formatting for charts\n--------------------------\n\nIf your chart as a time dimension on the x-axis, you can change the formatting of the x-axis label by using the **Time Label Format** setting in the **X** tab of the visualization options. You can format time values in by using the syntax on the [Time formatting for charts](/looker/docs/time-formatting-for-charts) page."]]