- Sort Score
- Num 10 results
- Language All
Results 1 - 10 of 33 for DECIMAL (0.06 seconds)
-
tests/test_jsonable_encoder.py
def test_decimal_encoder_float(): data = {"value": Decimal(1.23)} assert jsonable_encoder(data) == {"value": 1.23} def test_decimal_encoder_int(): data = {"value": Decimal(2)} assert jsonable_encoder(data) == {"value": 2} def test_decimal_encoder_nan(): data = {"value": Decimal("NaN")} assert isnan(jsonable_encoder(data)["value"])
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Tue Feb 17 09:59:14 GMT 2026 - 9.2K bytes - Click Count (0) -
tests/test_multi_body_errors.py
from decimal import Decimal from dirty_equals import IsOneOf from fastapi import FastAPI from fastapi.testclient import TestClient from inline_snapshot import snapshot from pydantic import BaseModel, condecimal app = FastAPI() class Item(BaseModel): name: str age: condecimal(gt=Decimal(0.0)) # type: ignore @app.post("/items/") def save_item_no_body(item: list[Item]): return {"item": item}
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Feb 08 10:18:38 GMT 2026 - 6.7K bytes - Click Count (0) -
fastapi/encoders.py
Our Id type is a prime example of this. >>> decimal_encoder(Decimal("1.0")) 1.0 >>> decimal_encoder(Decimal("1")) 1 >>> decimal_encoder(Decimal("NaN")) nan """ exponent = dec_value.as_tuple().exponent if isinstance(exponent, int) and exponent >= 0: return int(dec_value) else: return float(dec_value)Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 10.9K bytes - Click Count (0) -
fastapi/param_functions.py
Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Sun Mar 15 11:44:39 GMT 2026 - 68K bytes - Click Count (0) -
docs/en/docs/tutorial/extra-data-types.md
* `bytes`: * Standard Python `bytes`. * In requests and responses will be treated as `str`. * The generated schema will specify that it's a `str` with `binary` "format". * `Decimal`: * Standard Python `Decimal`. * In requests and responses, handled the same as a `float`. * You can check all the valid Pydantic data types here: [Pydantic data types](https://docs.pydantic.dev/latest/usage/types/types/).Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Thu Mar 05 18:13:19 GMT 2026 - 2.6K bytes - Click Count (0) -
docs/zh-hant/docs/tutorial/extra-data-types.md
* 生成的 schema 會指定 `set` 的值為唯一(使用 JSON Schema 的 `uniqueItems`)。 * `bytes`: * 標準的 Python `bytes`。 * 在請求與回應中會被當作 `str` 處理。 * 生成的 schema 會指定其為 `str`,且 "format" 為 `binary`。 * `Decimal`: * 標準的 Python `Decimal`。 * 在請求與回應中,與 `float` 的處理方式相同。 * 你可以在此查閱所有可用的 Pydantic 資料型別:[Pydantic 資料型別](https://docs.pydantic.dev/latest/usage/types/types/)。 ## 範例 { #example } 以下是一個帶有參數、使用上述部分型別的 *路徑操作 (path operation)* 範例。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:05:38 GMT 2026 - 2.6K bytes - Click Count (0) -
docs/zh/docs/tutorial/extra-data-types.md
* 产生的模式将指定那些 `set` 的值是唯一的 (使用 JSON Schema 的 `uniqueItems`)。 * `bytes`: * 标准的 Python `bytes`。 * 在请求和响应中被当作 `str` 处理。 * 生成的模式将指定这个 `str` 是 `binary` "格式"。 * `Decimal`: * 标准的 Python `Decimal`。 * 在请求和响应中被当做 `float` 一样处理。 * 您可以在这里检查所有有效的 Pydantic 数据类型: [Pydantic data types](https://docs.pydantic.dev/latest/usage/types/types/)。 ## 例子 { #example } 下面是一个*路径操作*的示例,其中的参数使用了上面的一些类型。Created: Sun Apr 05 07:19:11 GMT 2026 - Last Modified: Fri Mar 20 17:06:37 GMT 2026 - 2.5K bytes - Click Count (0) -
android/guava/src/com/google/common/net/InetAddresses.java
Created: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Thu Mar 19 18:53:45 GMT 2026 - 47.7K bytes - Click Count (0) -
src/test/java/org/codelibs/fess/mylasta/direction/sponsor/FessTimeResourceProviderTest.java
assertTrue(defaultTz.getID().length() > 0); // Central timezone should match default assertEquals(defaultTz, FessUserTimeZoneProcessProvider.centralTimeZone); } // Test with decimal values in string (should be handled by config) @Test public void test_decimalStringValues() { FessConfig decimalConfig = new FessConfig.SimpleImpl() {
Created: Tue Mar 31 13:07:34 GMT 2026 - Last Modified: Fri Mar 13 23:01:26 GMT 2026 - 17.8K bytes - Click Count (0) -
android/guava/src/com/google/common/primitives/UnsignedLongs.java
long rem = dividend - quotient * divisor; return rem - (compare(rem, divisor) >= 0 ? divisor : 0); } /** * Returns the unsigned {@code long} value represented by the given decimal string. * * <p><b>Java 8+ users:</b> use {@link Long#parseUnsignedLong(String)} instead. * * @throws NumberFormatException if the string does not contain a valid unsigned {@code long} * valueCreated: Fri Apr 03 12:43:13 GMT 2026 - Last Modified: Mon Jan 05 22:13:21 GMT 2026 - 17.8K bytes - Click Count (0)