Data conversion
Data conversion is the transformation of a value or data from one type, format, or representation to another, explicitly or implicitly.
Get Programming: Learn to code with Python
- How it is used
- Makes values suitable for arithmetic, string output, and indexing when their current types do not fit the task.
- How deep it goes
- Defines explicit conversions and works through results, truncation, and an invalid string; does not explain implementation internals.
- Examples
- Uses short int, float, and str expressions, a squared user input, whole hours from minutes, and name halves.
- What you can do after
- Practice/perform it by converting typed numbers for calculations and division results into usable whole-number indices.
Read how Get Programming: Learn to code with Python explains data conversion →
Essential TypeScript 5, Third Edition
Type coercion is the conversion of a value from one JavaScript type to another during an operation or expression evaluation.
- How it is used
- Explains unexpected JavaScript results and motivates deliberate conversion when comparing, adding, or passing values to functions.
- How deep it goes
- Works through operator and function results, explicit conversion, fallbacks, and a TypeScript error; defers the full abstract-equality procedure to the specification.
- Examples
- Uses string and numeric prices, a price-summing function, a zero tax rate, missing object properties, and a formatted tax calculation.
- What you can do after
- Diagnose/debug with it: distinguish concatenation from addition, preserve zero-valued fallbacks, and recognize when TypeScript rejects JavaScript coercion.
Read how Essential TypeScript 5, Third Edition explains data conversion →
100 Java Mistakes and How to Avoid Them
Type conversion is the transformation or interpretation of a value from one Java type to another.
- How it is used
- Prevents numeric corruption, ambiguous varargs calls, and runtime cast failures at Java API boundaries.
- How deep it goes
- Explains narrowing overflow, integer-division truncation, guarded reference casts, and delayed generic-cast failures without detailing conversion specifications.
- Examples
- Uses file-length narrowing, fractional division, Object-to-String processing, and null passed to an Object varargs method.
- What you can do after
- Diagnose/debug with it by checking numeric ranges, expressing intended arithmetic, and replacing fragile casts with typed APIs or guarded checks.
Read how 100 Java Mistakes and How to Avoid Them explains data conversion →
Julia as a Second Language
Number conversion is the transformation of a value from one numeric type to another related numeric type.
- How it is used
- Supports explicit and implicit numeric conversions and supplies the conversions needed for mixed-type arithmetic.
- How deep it goes
- Works through constructors, `convert`, conversion failures, implicit assignments, and custom angle methods; defers detailed treatment of parametric types.
- Examples
- Uses numeric REPL conversions, `InexactError` cases, typed assignments, and DMS-to-radian conversion.
- What you can do after
- Build it from scratch: define angle-unit conversion methods and combine them with promotion rules for mixed-unit expressions.
Read how Julia as a Second Language explains data conversion →
Python Workout, Second Edition
Type conversion is the transformation of a value from one data type to another, often by calling a target type as a constructor.
- How it is used
- Uses conversion to turn user-provided strings into values suitable for numeric comparison, arithmetic, and collection construction.
- How deep it goes
- Explains target-type calls, common mismatches, and two integer-validation strategies, but does not develop conversion internals.
- Examples
- Demonstrates number guessing, rainfall accumulation, int(), float(), str(), list(), dict(), try/except, and isdigit().
- What you can do after
- Apply it via Python type constructors and validation patterns to process numeric user input safely.
Read how Python Workout, Second Edition explains data conversion →
Learn Rust in a Month of Lunches
Type casting explicitly converts a value from one Rust type to another compatible type.
- How it is used
- Uses explicit casts to convert between Rust types when a value cannot be used as another type directly.
- How deep it goes
- Works through `as` syntax, a rejected direct cast, a corrected two-step cast, and an out-of-range result.
- Examples
- Shows 100 becoming `d` through `u8` and `char`, and 256 becoming 0 when cast to `u8`.
- What you can do after
- Apply it via Rust’s `as` operator to make supported conversions and recognize an unexpected result when casting to `u8`.
Read how Learn Rust in a Month of Lunches explains data conversion →
100 C++ Mistakes and How to Avoid Them
The transformation of a value or object representation from one data type to another, either implicitly or explicitly requested.
- How it is used
- Uses type conversion to assess binary representation, API boundaries, language integration, and class-interface readability.
- How deep it goes
- Explains representation risks and explicit alternatives with code, but stops short of a broader conversion taxonomy.
- Examples
- Uses union-based binary output, reinterpret_cast with sizeof, and Rational-to-double comparisons.
- What you can do after
- Diagnose portability and readability hazards, then replace hardcoded or implicit conversions with compiler-sized or explicit alternatives.
Read how 100 C++ Mistakes and How to Avoid Them explains data conversion →
Java Persistence with Spring Data and Hibernate epub
Java-to-SQL type conversion is the transformation between Java property values and SQL-compatible database values.
- How it is used
- Maps entity property values to SQL-compatible values for persistence and schema generation.
- How deep it goes
- Details built-in type mappings and selected annotations, then identifies custom JPA converters and Hibernate UserType as extension options.
- Examples
- Uses numeric and temporal mapping tables, @Lob entity properties, and a Hibernate 'yes_no' boolean mapping.
- What you can do after
- Operate/configure it with @Column precision and scale, @Lob, or a Hibernate-specific boolean adapter; identify when a custom converter is needed.
Read how Java Persistence with Spring Data and Hibernate epub explains data conversion →
Modern C
Type conversion is the transformation of a C value from one type to another compatible type.
- How it is used
- Uses conversion to reconcile function arguments, expression results, pointer qualifiers, and carefully bounded memory inspection.
- How deep it goes
- Explains implicit and explicit conversions through code examples, but defers broader pointer and object-representation rules.
- Examples
- Uses a double-valued function call, pointer-conversion cases, and byte printing through an unsigned-character pointer.
- What you can do after
- Diagnose conversion mismatches, interpret implicit function conversions, and restrict explicit casts to justified byte-level inspection.
Learn PowerShell in a Month of Lunches: Fourth Edition, Covers Windows, Linux, and macOS
Casting is the operation of treating a value as a specified type, optionally converting it to an object of that type.
- How it is used
- Converts strings and other values into useful PowerShell object types or checks whether values already have a target type.
- How deep it goes
- Explains conversion syntax, numeric rounding, URI object properties, and Boolean type tests without developing custom type or formatting files.
- Examples
- Demonstrates URI casting, integer conversion after division, and string, Boolean, and datetime type checks.
- What you can do after
- Apply PowerShell casts with bracketed types, convert values using -as, and test types using -is.
Python How-To
- How it is used
- Converts textual input into typed values for comparisons, calculations, and further data processing.
- How deep it goes
- Explains numeric constructors, conversion errors, container evaluation, and manual parsing, while deferring exception handling details.
- Examples
- Uses age input, numeric strings, string representations of lists, tuples, and dictionaries, and comma-separated integer parsing.
- What you can do after
- Apply int, float, eval, or manual parsing to retrieve values represented by strings, while handling conversion failures and untrusted data carefully.
Rust in Action: Systems programming concepts and techniques
A type cast is an explicit conversion of a value from one data type to another.
- How it is used
- Makes numeric comparisons possible across types and translates timestamps between representations.
- How deep it goes
- Works through `as` and `try_into()`, then shows `From` implementations; defers a full explanation of traits and error handling.
- Examples
- Uses an `i32`–`u16` comparison, a `300_i32 as i8` cast, and NTP-to-`chrono::DateTime` conversion.
- What you can do after
- Apply it via `as` or `try_into()` for numeric conversion, and build it from scratch with `From` for a timestamp representation.
Read how Rust in Action: Systems programming concepts and techniques explains data conversion →
Learn SQL in a Month of Lunches
Type conversion is the operation of changing a value from one data type to another.
- How it is used
- Applies explicit type changes to dates, mixed values, and SQL filtering.
- How deep it goes
- Explains CONVERT and CAST syntax, automatic conversion, invalid results, and sorting effects, but not conversion internals.
- Examples
- Demonstrates converting PublicationDate to DATE, testing invalid TitleName conversion, and sorting concatenated prices.
- What you can do after
- Apply CAST and CONVERT to display date-only values and recognize invalid or performance-sensitive conversions.
Read how Learn SQL in a Month of Lunches explains data conversion →
Pro Angular 16
Type coercion is the implicit conversion of a value from one data type to another during an operation or comparison.
- How it is used
- Uses explicit conversion to prevent unexpected arithmetic, concatenation, comparisons, and fallback behavior.
- How deep it goes
- Explains implicit conversion, demonstrates number-string cases, and lists conversion methods without descending into runtime conversion rules.
- Examples
- Demonstrates 5 + 5 versus 5 + "5", explicit number-string conversion, and fallback handling for an undefined value and zero.
- What you can do after
- Apply explicit conversion with toString, String, Number, parseInt, and parseFloat to control operation results.
DuckDB in Action
Type coercion is the conversion of a value or column from one data type to another compatible type.
- How it is used
- Corrects inferred JSON and file schemas before numeric operations or analytical queries.
- How deep it goes
- Explains whole-STRUCT casting, query-time failures, and Parquet physical-to-logical type mappings.
- Examples
- Demonstrates casting football-shot coordinates and expected goals to DOUBLE, then inspecting an ATP rankings Parquet schema.
- What you can do after
- Apply it via DuckDB SQL to repair inferred schemas and diagnose incompatible values before querying.
Statistics Every Programmer Needs
Data type conversion is the process of changing values from one representation or data type to another.
- How it is used
- Prepares categorical football-play variables for decision trees and random forests.
- How deep it goes
- Demonstrates explicit mappings, conditional sign changes, and dtype inspection, but does not compare encoding strategies.
- Examples
- Uses Road/Home and Run/Pass mappings plus offensive-team score-differential sign normalization.
- What you can do after
- Apply it via pandas map and inspect converted columns with DataFrame.info().
Read how Statistics Every Programmer Needs explains data conversion →
Math for Web Design
Type conversion is the transformation of a value from one data type into another.
- How it is used
- Uses data conversion to make comparisons, layout calculations, and animation timing predictable.
- How deep it goes
- Explains automatic and explicit number conversion with operator examples, exercises, and common concatenation bugs.
- Examples
- Uses string-number comparisons, arithmetic with "5", conversion methods, and a restaurant-bill calculation.
- What you can do after
- Diagnose conversion bugs and apply Number(), unary +, parseInt(), parseFloat(), and strict equality.
Kotlin in Action, 2E
- How it is used
- Uses type checks and casts to select behavior for values represented through a shared type.
- How deep it goes
- Explains explicit casts, smart-cast stability, generic erasure, star projections, and runtime failure cases.
- Examples
- Demonstrates expression evaluation, numeric and string lists, star projections, safe casts, sets, and runtime cast exceptions.
- What you can do after
- Apply Kotlin type checks and casts while avoiding redundant casts and recognizing erased generic type limitations.
Modern C, Third Edition
A cast is an explicit C conversion construct that requests conversion of an expression to a specified type.
- How it is used
- Deploys explicit casts mainly for exceptional low-level operations such as inspecting an object's byte representation.
- How deep it goes
- Explains pointer-type information loss, compiler diagnostics, and incompatible-object risks, but stops short of broader cast forms.
- Examples
- Uses byte inspection, incompatible pointer assignments, and conversion between object pointers and character pointers.
- What you can do after
- Evaluate/understand when a C cast discards type information and why character-pointer inspection is a limited exception.
D3.js in Action, Third Edition
Type conversion is the transformation of a value from one data type to another, such as from a string to a number.
- How it is used
- Prepares imported CSV values for D3 visualizations by converting numeric strings into usable numbers.
- How deep it goes
- Explains row-by-row conversion in d3.csv(), retained keys, and formatting the complete dataset as an alternative.
- Examples
- Uses a technology-and-count CSV row, console inspection, and unary-plus conversion.
- What you can do after
- Apply it via d3.csv() to convert imported numeric strings and retain only fields needed for a visualization.
Read how D3.js in Action, Third Edition explains data conversion →
Fast Python: High performance techniques for large datasets
- How it is used
- Protects image-array arithmetic from overflow by widening pixel values before transformation.
- How deep it goes
- Demonstrates widening, clipping, and recasting through a worked pixel-brightening operation.
- Examples
- Uses grayscale image pixels, comparing addition and doubling before widening, clipping, and recasting.
- What you can do after
- Apply NumPy dtype widening, clipping, and recasting to preserve intended pixel values during brightness changes.
Read how Fast Python: High performance techniques for large datasets explains data conversion →
Related concepts
- integeruses · An integer is a whole-number value with no fractional part, including negative numbers, zero, and positive numbers.
- stringproduces · A string is a programming-language value representing an ordered sequence of characters or character units as text.
- abstract equality comparisonused by · Abstract equality comparison is JavaScript's equality algorithm that may convert operand types before comparing their values.
- ClassCastExceptionproduces · ClassCastException is a Java runtime exception thrown when a value cannot be cast to the requested reference type.
- data typeuses · A data type classifies values and specifies their representation or interpretation and the operations applicable to them.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




















