[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-31(UTC)"],[],[],null,["# Why are my fields with division showing up as 0?\n\nIn certain dialects, including Postgres and Redshift, performing a calculation between integers (like dividing counts) will return an integer even if the result would be a decimal in normal math. For example, you might make measures like the following: \n\n```\nmeasure: sold_ratio {\n type: number\n sql: ${sold_count} / ${total_count} ;;\n value_format: \"0.00\" # Number with exactly 2 decimals (1.23)\n}\nmeasure: sold_percent {\n type: number\n sql: 100 * ${sold_count} / ${count} ;;\n value_format: \"0.00\"\n}\n```\n\n\nHowever, when you run the measures in an Explore, the **Sold Ratio** column returns zero, and the **Sold Percent** column does not have its decimal places populated. This is not correct:\n\n\u003cbr /\u003e\n\n\nThe solution: Cast your field as a floating-point number\n--------------------------------------------------------\n\n\nIf the calculation is multiplied by a non-integer, the values will cast as floats, and decimals will be returned as expected. You can multiply the numerator by a decimal number (like 1.0 or 100.0) to force SQL to return a decimal result: \n\n```\nmeasure: sold_ratio {\n type: number\n sql: 1.0 * ${sold_count} / ${total_count};;\n value_format: \"0.00\"\n}\nmeasure: sold_percent {\n type: Number\n sql: 100.0 * ${sold_count} / ${count};;\n value_format: \"0.00\"\n}\n```\n\n\nThe resulting Explore **Data** table now displays the expected results:\n\n\n\u003cbr /\u003e"]]